| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRankings;
|
| | | import com.yeshi.fanli.exception.UserRankingsException;
|
| | | import com.yeshi.fanli.exception.user.UserRankingsException;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankingsService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/rankings")
|
| | |
| | |
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | | public void saveAdd(String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | try {
|
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }*/
|
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | |
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, UserRankings userRankings, HttpServletRequest request, |
| | | PrintWriter out) {
|
| | | public void saveModify(String callback, UserRankings userRankings, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Long id = userRankings.getId();
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("数据不存在或已被删除"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | boolean proess = false;
|
| | | for (UserRankings userRanking: list) {
|
| | | Long objid = userRanking.getId();
|
| | | if (id.equals(objid)){
|
| | | proess = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }
|
| | | }*/
|
| | | |
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ nickName +"] 此昵称已存在"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | Integer shareState = userRankings.getShareState();
|
| | | if (shareState != null && (shareState.equals(1) || shareState == 1)){
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadImg(String callback, Long id, @RequestParam("file") CommonsMultipartFile file, |
| | | HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | public void uploadImg(String callback, Long id, @RequestParam("file") CommonsMultipartFile file,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (file == null) {
|