diff --git a/luoo_music/src/main/java/com/luoo/music/controller/AlbumController.java b/luoo_music/src/main/java/com/luoo/music/controller/AlbumController.java index 1832010..3e2a63d 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/AlbumController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/AlbumController.java @@ -32,7 +32,7 @@ public class AlbumController { @Autowired private AlbumService albumService; - @ApiOperation(value = "查询专辑", notes = "查询专辑") + @ApiOperation(value = "分页查询专辑列表", notes = "查询专辑") @RequestMapping(value = "/list/{page}/{size}", method = RequestMethod.POST) public Result> search(@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "专辑查询对象", required = true) @RequestBody AlbumSearchDTO albumSearchDTO, @@ -87,7 +87,7 @@ public class AlbumController { @PostMapping(value = "/change/state/{id}/{state}") public Result changeState(@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "专辑id") @PathVariable String id, - @ApiParam(value = "想要修改的状态值 -1:不可抗力原因不允许显示,0:新建,1:待审核,2:退回,3:待上架,4:已上架,5:已删除")@PathVariable Integer state) { + @ApiParam(value = "想要修改的状态值 -1:不可抗力原因不允许显示,0:新建,1:待审核,2:退回,3:待上架,4:已上架,5:已删除,6:下架")@PathVariable Integer state) { albumService.changeAlbumState(token, id, state); return Result.success(); } diff --git a/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumSearchDTO.java b/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumSearchDTO.java index 89ae885..9925e39 100644 --- a/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumSearchDTO.java +++ b/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumSearchDTO.java @@ -20,7 +20,21 @@ public class AlbumSearchDTO implements Serializable { @ApiModelProperty("音乐人id") private String artistId; - @ApiModelProperty("专辑状态") + @ApiModelProperty("专辑状态 FORCE(-1 ,\"不可抗力原因不允许显示\"),\n" + + "\n" + + " SAVE(0, \"新建\"),\n" + + "\n" + + " IN_APPROVE(1, \"待审核\"),\n" + + "\n" + + " BACK(2, \"退回\"),\n" + + "\n" + + " WAIT_ARRIVE(3, \"待上架\"),\n" + + "\n" + + " ARRIVED(4, \"已上架\"),\n" + + "\n" + + " DELETE(5, \"已删除\"),\n" + + "\n" + + " REMOVAL(6, \"下架\")") private Integer state; @ApiModelProperty("时间查询条件 null-全部时间,1-今年,2-最近一月,3-最近一周,4-最近24小时") diff --git a/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java b/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java index 662f347..cb25034 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java @@ -1,20 +1,18 @@ package com.luoo.user.controller; +import api.PageResult; import api.Result; import com.luoo.user.dto.UserProcessApproveDto; import com.luoo.user.dto.artist.ArtistRegisterDto; import com.luoo.user.dto.artist.ArtistUserBindDto; +import com.luoo.user.pojo.ArtistInfo; import com.luoo.user.service.ArtistService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; /** * @Author: yawei.huang @@ -34,28 +32,43 @@ public class ArtistController { @ApiOperation(value = "音乐人注册", notes = "音乐人注册") @PostMapping("/register") - public Result register(@ApiParam(value = "注册对象", required = true) @Valid @RequestBody ArtistRegisterDto artistRegisterDto) { + public Result register(@RequestHeader(value = "Authorization", required = true) String authorization, + @Validated @RequestBody ArtistRegisterDto artistRegisterDto) { artistService.artistRegister(artistRegisterDto); return Result.success(); } - @ApiOperation(value = "音乐人审核",notes = "音乐人审核") + @ApiOperation(value = "未审核的音乐人列表", notes = "未审核的音乐人列表") + @GetMapping("/list/un-approve/{page}/{size}") + public Result> getUnApproveList(@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, + @ApiParam(value = "页码", required = true) @PathVariable Integer page, + @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { + return Result.success(artistService.getUnApproveList(page, size)); + } + + @ApiOperation(value = "音乐人审核", notes = "音乐人审核") @PostMapping("/approve") - public Result approve(@ApiParam(value = "音乐人审核对象", required = true) @Valid @RequestBody UserProcessApproveDto userProcessApproveDto) { + public Result approve( + @RequestHeader(value = "Authorization", required = true) String authorization, + @ApiParam(value = "音乐人审核对象", required = true) @Validated @RequestBody UserProcessApproveDto userProcessApproveDto) { artistService.approve(userProcessApproveDto); return Result.success(); } @ApiOperation(value = "音乐人-成员绑定", notes = "音乐人-成员绑定") @PostMapping("/bind") - public Result memberBind(@ApiParam(value = "绑定对象",required = true) @Valid @RequestBody ArtistUserBindDto artistUserBindDto) { + public Result memberBind( + @RequestHeader(value = "Authorization", required = true) String authorization, + @ApiParam(value = "绑定对象", required = true) @Validated @RequestBody ArtistUserBindDto artistUserBindDto) { artistService.bindArtistAndMember(artistUserBindDto); return Result.success(); } @ApiOperation(value = "音乐人-成员解绑", notes = "音乐人-成员解绑") @PostMapping("/unbind") - public Result memberUnBind(@ApiParam(value = "解绑对象",required = true) @Valid @RequestBody ArtistUserBindDto artistUserBindDto) { + public Result memberUnBind( + @RequestHeader(value = "Authorization", required = true) String authorization, + @ApiParam(value = "解绑对象", required = true) @Validated @RequestBody ArtistUserBindDto artistUserBindDto) { artistService.unBindArtistAndMember(artistUserBindDto); return Result.success(); } diff --git a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java index 28789d9..3afcafe 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java @@ -575,6 +575,27 @@ public class MyController extends BaseController { return Result.success(); } + @ApiOperation(value = "15.4 获取实名认证详情") + @GetMapping("/get/real/name/{id}") + public Result getUserRealName( + @RequestHeader(value = "Authorization", required = true) String authorization, + @ApiParam(value = "实名认证的id" ,required = true)@PathVariable String id) { + return Result.success(userInfoService.getUserRealName(id)); + } + + @ApiOperation(value = "15.5 查询实名认证列表") + @ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = "分页: 页码,以1开始", required = true), + @ApiImplicitParam(name = "pageSize", value = "分页: 每页数量", required = true)}) + @GetMapping("/real/name/{pageNum}/{pageSize}") + @GlobalInterceptor(checkAppUserLogin = true) + public Result> getUserRealNameList( + @RequestHeader(value = "Authorization", required = true) String authorization, + @PathVariable @VerifyParam(required = true) Integer pageNum, + @PathVariable @VerifyParam(required = true) Integer pageSize) { + + return Result.success(userInfoService.getUserRealNameList()); + } + /** * 获取用户实名认证信息 * diff --git a/luoo_user/src/main/java/com/luoo/user/dao/ArtistInfoDao.java b/luoo_user/src/main/java/com/luoo/user/dao/ArtistInfoDao.java index 964c333..82c6840 100644 --- a/luoo_user/src/main/java/com/luoo/user/dao/ArtistInfoDao.java +++ b/luoo_user/src/main/java/com/luoo/user/dao/ArtistInfoDao.java @@ -1,8 +1,11 @@ package com.luoo.user.dao; import com.luoo.user.pojo.ArtistInfo; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; /** * @Author: yawei.huang @@ -12,5 +15,11 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; * @Filename: ArtistDao * @Describe: */ -public interface ArtistInfoDao extends JpaRepository, JpaSpecificationExecutor { +public interface ArtistInfoDao extends JpaRepository, JpaSpecificationExecutor { + + + @Query(value = " select t1.* from tb_artist_info t1 left join tb_user_process t2 on t1.user_id = t2.user_id \n" + + " where t2.type = 1 and status = 0", countProjection = "t1.id", nativeQuery = true) + public Page findListByCheckState(Pageable pageable); + } diff --git a/luoo_user/src/main/java/com/luoo/user/dto/UserProcessApproveDto.java b/luoo_user/src/main/java/com/luoo/user/dto/UserProcessApproveDto.java index 0461072..591f6a7 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/UserProcessApproveDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/UserProcessApproveDto.java @@ -17,14 +17,14 @@ import java.io.Serializable; @Data public class UserProcessApproveDto implements Serializable { - @ApiModelProperty(name = "id") + @ApiModelProperty("id") @NotBlank(message = "id必填") private String id; - @ApiModelProperty(name = "审核结果") + @ApiModelProperty("审核结果 1-通过 2-拒绝") @NotBlank(message = "审核结果必填") private Integer status; - @ApiModelProperty(name = "拒绝理由") + @ApiModelProperty("拒绝理由") private String content; } diff --git a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistRegisterDto.java b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistRegisterDto.java index 018f3b4..5269ca7 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistRegisterDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistRegisterDto.java @@ -17,57 +17,57 @@ import java.io.Serializable; */ @Data public class ArtistRegisterDto implements Serializable { - @ApiModelProperty(name = "歌手名") + @ApiModelProperty("歌手名") @NotBlank(message = "歌手名必填") private String nickName; - @ApiModelProperty(name = "艺人头像") + @ApiModelProperty("艺人头像") @NotBlank(message = "艺人头像必填") private String avatar; - @ApiModelProperty(name = "主页背景") + @ApiModelProperty("主页背景") private String backgroundImage; - @ApiModelProperty(name = "播放器音乐人管理后台实时截图") + @ApiModelProperty("播放器音乐人管理后台实时截图") @NotBlank(message = "后台截图必填") private String screenshot; - @ApiModelProperty(name = "所在地区") + @ApiModelProperty("所在地区") @NotBlank(message = "所在地区必填") private String address; - @ApiModelProperty(name = "流派风格") + @ApiModelProperty("流派风格") @NotBlank(message = "流派风格必填") private String style; - @ApiModelProperty(name = "艺人类型") + @ApiModelProperty("艺人类型") @NotNull(message = "艺人类型必填") private Integer type; - @ApiModelProperty(name = "艺人简介") + @ApiModelProperty("艺人简介") @NotBlank(message = "艺人简介必填") private String description; - @ApiModelProperty(name = "所属公司/厂牌") + @ApiModelProperty("所属公司/厂牌") private String bandUserId; - @ApiModelProperty(name = "登录用户名") + @ApiModelProperty("登录用户名") @NotBlank(message = "用户名必填") private String userName; - @ApiModelProperty(name = "密码") + @ApiModelProperty("密码") @NotBlank(message = "密码必填") private String password; -// @ApiModelProperty(name = "负责人名称") +// @ApiModelProperty("负责人名称") // @NotBlank(message = "负责人名称必填") // private String responsibleName; // -// @ApiModelProperty(name = "性别") +// @ApiModelProperty("性别") // @NotNull(message = "负责人性别必填") // private Integer sex; // -// @ApiModelProperty(name = "负责人手机") +// @ApiModelProperty("负责人手机") // @NotBlank(message = "负责人手机必填") // private String mobile; diff --git a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistUserBindDto.java b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistUserBindDto.java index 2541470..e437e37 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistUserBindDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistUserBindDto.java @@ -16,11 +16,11 @@ import java.io.Serializable; */ @Data public class ArtistUserBindDto implements Serializable { - @ApiModelProperty(name = "音乐人id") + @ApiModelProperty("音乐人id") @NotNull(message = "音乐人id必填") private String artistId; - @ApiModelProperty(name = "成员id") + @ApiModelProperty("成员id") @NotNull(message = "成员id必填") private String UserId; } diff --git a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java index b54cf1f..6eda745 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java @@ -1,10 +1,14 @@ package com.luoo.user.service; +import api.PageResult; import com.luoo.user.dao.*; import com.luoo.user.dto.UserProcessApproveDto; import com.luoo.user.dto.artist.ArtistRegisterDto; import com.luoo.user.dto.artist.ArtistUserBindDto; -import com.luoo.user.pojo.*; +import com.luoo.user.pojo.ArtistInfo; +import com.luoo.user.pojo.ArtistUser; +import com.luoo.user.pojo.UserInfo; +import com.luoo.user.pojo.UserProcess; import constants.Constants; import enums.UserProcessStatusEnum; import enums.UserProcessTypeEnum; @@ -14,6 +18,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -125,6 +132,18 @@ public class ArtistService { userProcessDao.save(userProcess); } + /** + * 获取未审批的音乐人注册申请 + * + * @return 未审批的分页列表 + */ + public PageResult getUnApproveList(Integer page, Integer size) { + Pageable pageable = PageRequest.of(page - 1, size); + Page artistInfoPage = artistInfoDao.findListByCheckState(pageable); + long totalElements = artistInfoPage.getTotalElements(); + return new PageResult<>(totalElements, artistInfoPage.getContent()); + } + /** * 音乐人审核 * diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java index d6a0202..a4bb671 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java @@ -523,6 +523,25 @@ public class UserInfoService { userRealNameDao.save(userRealName); } + /** + * 查询实名认证列表 + * + * @return 列表 + */ + public List getUserRealNameList() { + return userRealNameDao.findAll(); + } + + /** + * 根据id查询实名认证详情 + * + * @param id id + * @return 实名认证详情 + */ + public UserRealName getUserRealName(String id) { + return userRealNameDao.findById(id).get(); + } + /** * 根据用户id获取是否有已通过的实名认证信息 *