Commit 1a435d4e authored by m1991's avatar m1991

后台接口——用户与资讯后台接口

parent 5027eab7
......@@ -73,7 +73,7 @@ public interface UploadService {
* @param zxid
* @return
*/
Map toExamine(Integer zxid);
Map toExamine(Integer zxid,Integer approval);
}
......@@ -486,24 +486,23 @@ public class UploadServiceImpl implements UploadService {
}
return map;
}
/**
* 资讯审核
*
* 资讯审核-----1是通过 0是驳回
* @param zxid
* @param approval
* @return
*/
@Override
public Map toExamine(Integer zxid) {
public Map toExamine(Integer zxid,Integer approval) {
Map map = new HashMap();
try {
shopZx shopZx = shopZxMapper.selectByzxid(zxid);
if (null != shopZx) {
Integer ZxToExamine = shopZx.setZxToExamine(1);
Integer ZxToExamine = shopZx.setZxToExamine(approval);
shopZxMapper.updateZxToExaminezxid(zxid, ZxToExamine);
}
map.put("code", 0);
map.put("msg", "审核通过!");
map.put("msg", "审核成功!");
} catch (BaseException e) {
map.put("code", 1);
map.put("msg", "审核失败!");
......
......@@ -27,7 +27,7 @@ import java.util.Map;
*/
@Api(tags = "资讯管理")
@RestController
@RequestMapping("/ZX")
@RequestMapping("")
@Slf4j
public class UploadController {
......@@ -56,7 +56,7 @@ public class UploadController {
@ApiImplicitParam(name = "file", value = "视频文件", dataType = "MultipartFile"),
@ApiImplicitParam(name = "zxAddress", value = "资讯发布地址", dataType = "String"),
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = true, dataType = "String")})
@RequestMapping(value = "/uploadVideo", method = RequestMethod.POST)
@RequestMapping(value = "/admin/ZX/uploadVideo", method = RequestMethod.POST)
public Map<String, Object> uploadVideo(@RequestParam(value = "files")MultipartFile file, HttpServletRequest request, String zxField, String inviteCode) throws Exception {
return uploadService.uploadVideo(file, request, zxField,inviteCode);
}
......@@ -70,7 +70,7 @@ public class UploadController {
*/
@ApiOperation(value = "用户头像上传接口", notes = "返回路径给前台", httpMethod = "POST", produces = "application/json; charset=UTF-8")
@ApiImplicitParam(name = "file", value = "单图片", dataType = "MultipartFile")
@RequestMapping(value = "/uploadImage", method = RequestMethod.POST)
@RequestMapping(value = "/ZX/uploadImage", method = RequestMethod.POST)
public Map<String, Object> uploadImage(@RequestParam(value = "files")MultipartFile file,String inviteCode) throws Exception {
return uploadService.uploadImage(file,inviteCode);
}
......@@ -90,7 +90,7 @@ public class UploadController {
@ApiImplicitParam(name = "files", value = "多图片", paramType = "form", allowMultiple=true, dataType = "__file"),
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = true, dataType = "String")})
@RequestMapping(method = RequestMethod.POST, value = "/multipleImageUpload", headers = "content-type=multipart/form-data")
@RequestMapping(method = RequestMethod.POST, value = "/ZX/multipleImageUpload", headers = "content-type=multipart/form-data")
public Map multipleImageUpload(@RequestParam(required=false,value = "files") MultipartFile[] files, String zxField, String inviteCode) {
return uploadService.imageUpload(files, zxField,inviteCode);
......@@ -107,7 +107,7 @@ public class UploadController {
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "从几开始", required = true,dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "一页展示数量", required = true, dataType = "Integer")})
@RequestMapping(method = RequestMethod.GET, value = "/zxAll")
@RequestMapping(method = RequestMethod.GET, value = "/ZX/zxAll")
public Map selectPage(int pageNum, int pageSize,String inviteCode){
return uploadService.selectPage(pageNum,pageSize,inviteCode);
......@@ -120,20 +120,22 @@ public class UploadController {
@ApiImplicitParams({
@ApiImplicitParam(name = "zxid", value = "资讯ID", required = true, dataType = "int"),
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = true, dataType = "String")})
@RequestMapping(method = RequestMethod.POST, value = "/thumbUp")
@RequestMapping(method = RequestMethod.POST, value = "/admin/ZX/thumbUp")
public Map like(int zxid,String inviteCode){
return uploadService.Ilike(zxid,inviteCode);
}
/**
* TODO 审核接口
* TODO 审核接口 0通过 1驳回
*/
@ApiOperation(value = "用户发布资讯信息审核接口", notes = "审核接口",produces = "application/json; charset=UTF-8")
@ApiImplicitParam(name = "zxid", value = "资讯ID", required = true, dataType = "int")
@RequestMapping(method = RequestMethod.POST, value = "/toExamine")
public Map ToExamine(int zxid){
@ApiImplicitParams({
@ApiImplicitParam(name = "zxid", value = "资讯ID", required = true, dataType = "int"),
@ApiImplicitParam(name = "approval", value = "核准字段:1是通过 0是驳回", required = true, dataType = "int")})
@RequestMapping(method = RequestMethod.POST, value = "/admin/ZX/toExamine")
public Map ToExamine(int zxid ,int approval){
return uploadService.toExamine(zxid);
return uploadService.toExamine(zxid,approval);
}
/**
......@@ -141,7 +143,7 @@ public class UploadController {
*/
@ApiOperation(value = "后台-资讯列表", notes = "资讯列表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "CultivatingPrizeDto")
@GetMapping("/queryShopZxList")
@GetMapping("/admin/ZX/queryShopZxList")
public R<PageInfo<ShopZxUserVo>> queryShopZxList(ShopZxUserDto shopZxUserDto){
return uploadService.getShopZxUserList(shopZxUserDto);
}
......
......@@ -28,7 +28,6 @@ import java.util.Map;
*/
@Api(tags = "用户管理")
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController extends BaseController {
......@@ -65,7 +64,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String")
@GetMapping("/getByUserId")
@GetMapping("/user/getByUserId")
public User getByUserId(String userId) {
return userService.getById(userId);
}
......@@ -73,10 +72,10 @@ public class UserController extends BaseController {
/**
* shiro登录
*
* @return
* @return/user
*/
@ApiOperation(value = "获取token接口", notes = "获取token接口", httpMethod = "POST")
@PostMapping(value = "/login")
@PostMapping(value = "/user/login")
public R<String> login(String id) {
if (null == id) {
return R.error("入参为空!");
......@@ -93,7 +92,7 @@ public class UserController extends BaseController {
}
@ApiOperation(value = "获取用户森林状态接口", notes = "获取用户森林状态接口", httpMethod = "GET")
@GetMapping("/forestStatus")
@GetMapping("/user/forestStatus")
public R<Map> forestStatus(String userId) {
if (null == userId) {
return R.error("入参为空");
......@@ -108,7 +107,7 @@ public class UserController extends BaseController {
}
@ApiOperation(value = "获取用户我的直推信息", notes = "获取用户我的直推信息", httpMethod = "GET")
@GetMapping("/myRecommend")
@GetMapping("/user/myRecommend")
public R<Map> getMyRecommend(String userId) {
//用户id
int userLevel = userService.getByUserId(userId).getUserLevel();
......@@ -121,21 +120,21 @@ public class UserController extends BaseController {
}
@ApiOperation(value = "获取用户我的团队信息", notes = "获取用户我的团队推信息", httpMethod = "GET")
@GetMapping("/myTeam")
@GetMapping("/user/myTeam")
public R<TeamUserInfo> getMyTeam(String userId) {
TeamUserInfo myTeam = teamUserInfoService.getOneById(userId);
return R.ok(myTeam);
}
@ApiOperation(value = "获取用户我的直推信息详情", notes = "获取用户我的直推信息详情", httpMethod = "GET")
@GetMapping("/myRecommendInfo")
@GetMapping("/user/myRecommendInfo")
public R<List<UserAndRecommendVo>> getMyRecommendInfo(@RequestParam("userId") String userId, @RequestParam("userlevel") int userlevel) {
List<UserAndRecommendVo> myRecommendInfo = recommendUserService.getMyRecommendInfo(userId, userlevel);
return R.ok(myRecommendInfo);
}
@ApiOperation(value = "查询空投池信息", notes = "查询空投池信息", httpMethod = "GET")
@GetMapping("/queryAerialDelivery")
@GetMapping("/user/queryAerialDelivery")
public R<AerialDeliveryVo> queryAerialDelivery() {
log.info("shop-mall[]UserController[]queryAerialDelivery[]input.method");
......@@ -148,7 +147,7 @@ public class UserController extends BaseController {
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String"),
@ApiImplicitParam(name = "headImage", value = "头像Url", dataType = "String")
})
@PostMapping("/setHeadImage")
@PostMapping("/user/setHeadImage")
public R<Boolean> setHeadImage(String userId, String headImage) {
log.info("shop-mall[]UserController[]setHeadImage[]input.param.userId,headImage:" + userId, headImage);
if (StringUtils.isBlank(userId) || StringUtils.isBlank(headImage)) {
......@@ -163,7 +162,7 @@ public class UserController extends BaseController {
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String"),
@ApiImplicitParam(name = "inviteCode", value = "邀请码", dataType = "String")
})
@PostMapping("/fillInInviteCode")
@PostMapping("/user/fillInInviteCode")
public R<Boolean> fillInInviteCode(String userId, String inviteCode) {
log.info("shop-mall[]UserController[]fillInInviteCode[]input.param.userId,inviteCode:" + userId, inviteCode);
if (StringUtils.isBlank(userId) || StringUtils.isBlank(inviteCode)) {
......@@ -175,7 +174,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "后台-用户列表", notes = "用户列表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "TeamQueryDto")
@GetMapping("/queryUserList")
@GetMapping("/admin/user/queryUserList")
public R<PageInfo<User>> queryUserList(TeamQueryDto queryDto) {
log.info("shop-mall[]UserController[]queryUserList[]input.param.query:" + queryDto);
return userService.getUserList(queryDto);
......@@ -183,7 +182,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "后台-直推用户列表", notes = "直推用户列表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "RecommendUserDto")
@GetMapping("/queryRecommendUserList")
@GetMapping("/admin/user/queryRecommendUserList")
public R<PageInfo<RecommendUserVo>> queryRecommendUserList(RecommendUserDto recommendUserDto) {
log.info("shop-mall[]UserController[]queryRecommendUserList[]input.param.query:" + recommendUserDto);
return recommendUserService.getRecommendUserList(recommendUserDto);
......@@ -191,7 +190,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "后台-团队用户列表", notes = "团队用户列表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "TeamUserInfoDto")
@GetMapping("/queryTeamUserInfoList")
@GetMapping("/admin/user/queryTeamUserInfoList")
public R<PageInfo<TeamUserInfoVo>> queryTeamUserInfoList(TeamUserInfoDto teamUserInfoDto) {
log.info("shop-mall[]UserController[]queryTeamUserInfoList[]input.param.query:" + teamUserInfoDto);
return teamUserInfoService.getTeamUserInfoList(teamUserInfoDto);
......@@ -199,14 +198,14 @@ public class UserController extends BaseController {
@ApiOperation(value = "后台-培育奖记录表", notes = "培育奖记录表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "CultivatingPrizeInfoDto")
@GetMapping("/queryCultivatingInfo")
@GetMapping("/admin/user/queryCultivatingInfo")
public R<PageInfo<CultivatingPrizeInfoVo>> queryCultivatingPrizeInfoList(CultivatingPrizeInfoDto cultivatingPrizeInfoDto) {
log.info("shop-mall[]UserController[]queryCultivatingPrizeInfoList[]input.param.query:" + cultivatingPrizeInfoDto);
return cultivatingPrizeInfoService.getCultivatingPrizeInfoList(cultivatingPrizeInfoDto);
}
@ApiOperation(value = "后台-培育奖表列表", notes = "培育奖表列表", httpMethod = "GET")
@GetMapping("/queryCultivatingPrizeInfoList")
@GetMapping("/admin/user/queryCultivatingPrizeInfoList")
public R<List<CultivatingPrize>> queryCultivatingPrizeList() {
log.info("shop-mall[]UserController[]queryCultivatingPrizeList[]input.param.query:");
return cultivatingPrizeService.getCultivatingPrizeList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment