release- 新增查询接口

release-2024-08-08
pikaqiudeshujia 7 months ago
parent 04f28b30c7
commit 147d3bd118

@ -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<PageResult<ArtistAlbum>> 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<Void> 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();
}

@ -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小时")

@ -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<Void> register(@ApiParam(value = "注册对象", required = true) @Valid @RequestBody ArtistRegisterDto artistRegisterDto) {
public Result<Void> 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<PageResult<ArtistInfo>> 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<Void> approve(@ApiParam(value = "音乐人审核对象", required = true) @Valid @RequestBody UserProcessApproveDto userProcessApproveDto) {
public Result<Void> 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<Void> memberBind(@ApiParam(value = "绑定对象",required = true) @Valid @RequestBody ArtistUserBindDto artistUserBindDto) {
public Result<Void> 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<Void> memberUnBind(@ApiParam(value = "解绑对象",required = true) @Valid @RequestBody ArtistUserBindDto artistUserBindDto) {
public Result<Void> memberUnBind(
@RequestHeader(value = "Authorization", required = true) String authorization,
@ApiParam(value = "解绑对象", required = true) @Validated @RequestBody ArtistUserBindDto artistUserBindDto) {
artistService.unBindArtistAndMember(artistUserBindDto);
return Result.success();
}

@ -575,6 +575,27 @@ public class MyController extends BaseController {
return Result.success();
}
@ApiOperation(value = "15.4 获取实名认证详情")
@GetMapping("/get/real/name/{id}")
public Result<UserRealName> 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<List<UserRealName>> 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());
}
/**
*
*

@ -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<ArtistInfo,String>, JpaSpecificationExecutor<ArtistInfo> {
public interface ArtistInfoDao extends JpaRepository<ArtistInfo, String>, JpaSpecificationExecutor<ArtistInfo> {
@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<ArtistInfo> findListByCheckState(Pageable pageable);
}

@ -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;
}

@ -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;

@ -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;
}

@ -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<ArtistInfo> getUnApproveList(Integer page, Integer size) {
Pageable pageable = PageRequest.of(page - 1, size);
Page<ArtistInfo> artistInfoPage = artistInfoDao.findListByCheckState(pageable);
long totalElements = artistInfoPage.getTotalElements();
return new PageResult<>(totalElements, artistInfoPage.getContent());
}
/**
*
*

@ -523,6 +523,25 @@ public class UserInfoService {
userRealNameDao.save(userRealName);
}
/**
*
*
* @return
*/
public List<UserRealName> getUserRealNameList() {
return userRealNameDao.findAll();
}
/**
* id
*
* @param id id
* @return
*/
public UserRealName getUserRealName(String id) {
return userRealNameDao.findById(id).get();
}
/**
* id
*

Loading…
Cancel
Save