Explorar el Código

Merge remote-tracking branch 'origin/test'

limin hace 7 años
padre
commit
b00773cdc8

+ 2 - 2
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -135,7 +135,7 @@ public class OpenAppHomeController extends BaseApiController{
 		map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
 		map.put("tag", jtTagService.selectListJtTag(null, 1, 99));
 		
-		map.put("homeImg", bannersService.findAppBannersList( apiUrl,1, 1, 1));
+		map.put("homeImg", bannersService.findAdminBannersList( apiUrl,1, 1, 1));
 		result.setData(map);
 		return result;
 	}
@@ -151,7 +151,7 @@ public class OpenAppHomeController extends BaseApiController{
 		Map<String, Object> map=new HashMap<>();
 		//1 赚钱数据    2首页数据
 		map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
-		map.put("homeImg", bannersService.findAppBannersList( apiUrl,1, 3, 1));
+		map.put("homeImg", bannersService.findAdminBannersList( apiUrl,1, 3, 1));
 		result.setData(map);
 		return result;
 	}

+ 49 - 10
src/main/java/com/goafanti/banners/controller/AdminBannersApiController.java

@@ -3,19 +3,13 @@ package com.goafanti.banners.controller;
 import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-import org.junit.runner.Request;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.util.Assert;
-import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-
 import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.Result;
@@ -93,38 +87,83 @@ public class AdminBannersApiController extends BaseApiController {
 		}
 		return res().data(types);
 	}
-	
+	/**
+	 * 新增轮播图
+	 * @param b
+	 * @return
+	 */
 	@RequestMapping(value="/save" ,method=RequestMethod.POST)
 	public Result save(Banners b){
 		Result result=new Result();
 		result.setData(bannersService.insertBanner(b));
 		return result;
 	}
+	/**
+	 * 删除轮播图
+	 * @param id
+	 * @return
+	 */
 	@RequestMapping(value="/delete" ,method=RequestMethod.POST)
 	public Result delete(String  id){
 		Result result=new Result();
 		result.setData(bannersService.deleteBanner(id));
 		return result;
 	}
+	/**
+	 * 轮播图详情
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value="/details" ,method=RequestMethod.GET)
+	public Result details(String  id){
+		Result result=new Result();
+		result.setData(bannersService.selectByPrimaryKey(id));
+		return result;
+	}
+	/**
+	 * 修改轮播图
+	 * @param b
+	 * @return
+	 */
 	@RequestMapping(value="/update" ,method=RequestMethod.POST)
 	public Result details(Banners b){
 		Result result=new Result();
 		result.setData(bannersService.updateBanner(b));
 		return result;
 	}
+	/**
+	 * 获取分页轮播图
+	 * @param apiUrl
+	 * @param client
+	 * @param pageSize
+	 * @param pageNo
+	 * @param request
+	 * @return
+	 */
+	
 	@RequestMapping(value="/list" ,method=RequestMethod.GET)
 	public Result list(String apiUrl,Integer client,Integer pageSize,Integer pageNo,HttpServletRequest request){
 		Result result=new Result();
 		result.setData(bannersService.findBannersList( apiUrl,client, pageSize, pageNo));
 		return result;
 	}
-	@RequestMapping(value="/appList" ,method=RequestMethod.GET)
+	/**
+	 * 获取集合轮播图
+	 * @param apiUrl
+	 * @param client
+	 * @param pageSize
+	 * @param pageNo
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value="/adminList" ,method=RequestMethod.GET)
 	public Result appList(String apiUrl,Integer client,Integer pageSize,Integer pageNo,HttpServletRequest request){
 		Result result=new Result();
-		result.setData(bannersService.findAppBannersList( apiUrl,client, pageSize, pageNo));
+		result.setData(bannersService.findAdminBannersList( apiUrl,client, pageSize, pageNo));
 		return result;
 	}
 	
+	
 
     /**
      * 图片上传
@@ -134,7 +173,7 @@ public class AdminBannersApiController extends BaseApiController {
         Result res = new Result();
         AttachmentType attachmentType = AttachmentType.getField(sign);
         if (attachmentType == AttachmentType.BANNERS_PIC) {
-            res.setData(handleFiles(res, "/banners", false, req, sign, "banners"));
+            res.setData(handleFiles(res, "/", false, req, sign, "banners"));
         } else {
             res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "图片标示"));
         }

+ 4 - 1
src/main/java/com/goafanti/banners/service/BannersService.java

@@ -41,8 +41,11 @@ public class BannersService extends BaseMybatisDao<BannersMapper> {
 	public int deleteBanner(String id) {
 		return bannersMapper.deleteByPrimaryKey(id);
 	}
+	public Banners selectByPrimaryKey(String id) {
+		return bannersMapper.selectByPrimaryKey(id);
+	}
 
-	public List<Banners> findAppBannersList(String apiUrl,Integer client,Integer pageSize,Integer pageNo) {
+	public List<Banners> findAdminBannersList(String apiUrl,Integer client,Integer pageSize,Integer pageNo) {
 		return portalBanners(apiUrl, client, pageNo, pageSize);
 	}
 	

+ 1 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -97,7 +97,7 @@ public class FileUtils {
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		boolean uniq = false;
 		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1
-				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1) {
+				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1|| sign.indexOf("banners")!=-1) {
 			uniq = true;
 		}
 		String fileName = "";

+ 0 - 1
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -144,7 +144,6 @@ public class UserRegisterController extends BaseController {
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setLvl(0);
-			us.setType(0);
 			us.setNickname(user.getUsername());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -55,7 +55,7 @@ app.name=AFT
 app.mobile.website=http://m.kedexinxi.com
 template.cacheable=false
 
-static.host=//sclient.jishutao.com:8088/client/1.0.0
+static.host=//sclient.jishutao.com:80/client/1.0.0
 portal.host=//sportal.jishutao.com:80/portal/1.0.0
 avatar.host=//sclient.jishutao.com
 avatar.upload.host=//sclient.jishutao.com/upload