42 changed files with 847 additions and 31 deletions
@ -0,0 +1,80 @@ |
|||||
|
package com.bnyer.img.controller; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.bnyer.common.core.web.controller.BaseController; |
||||
|
import com.bnyer.common.core.web.domain.AjaxResult; |
||||
|
import com.bnyer.common.core.web.page.TableDataInfo; |
||||
|
import com.bnyer.img.domain.Notice; |
||||
|
import com.bnyer.img.dto.NoticeDto; |
||||
|
import com.bnyer.img.dto.NoticePageDto; |
||||
|
import com.bnyer.img.dto.StatusDto; |
||||
|
import com.bnyer.img.service.NoticeService; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Api(value = "img-notice-【后端】公告接口",tags = "img-notice-【后端】公告接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/img/notice") |
||||
|
@Slf4j |
||||
|
public class NoticeController extends BaseController { |
||||
|
|
||||
|
@Autowired |
||||
|
private NoticeService noticeService; |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="查询notice分页") |
||||
|
@PostMapping("/page") |
||||
|
public TableDataInfo pageNotice(@RequestBody @ApiParam("分页对象") NoticePageDto dto){ |
||||
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
||||
|
List<Notice> notices = noticeService.queryPage(dto); |
||||
|
return getDataTable(notices); |
||||
|
} |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="新增notice") |
||||
|
@PostMapping(value = "/insert") |
||||
|
public AjaxResult insertNotice(@Validated @RequestBody @ApiParam("notice对象")NoticeDto dto){ |
||||
|
log.debug("新增notice参数为:{}", JSON.toJSONString(dto)); |
||||
|
return AjaxResult.success(noticeService.insert(dto.extractParam())); |
||||
|
} |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="修改notice") |
||||
|
@PostMapping(value = "/update") |
||||
|
public AjaxResult updateNotice(@Validated @RequestBody @ApiParam("notice对象")NoticeDto dto){ |
||||
|
log.debug("修改notice参数为:{}", JSON.toJSONString(dto)); |
||||
|
return AjaxResult.success(noticeService.update(dto.extractParam())); |
||||
|
} |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="删除notice") |
||||
|
@DeleteMapping(value = "/delete/{ids}") |
||||
|
public AjaxResult deleteNotice(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
||||
|
log.debug("删除notice参数为:{}", JSON.toJSONString(ids)); |
||||
|
return AjaxResult.success(noticeService.delete(ids)); |
||||
|
} |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="查询notice详情") |
||||
|
@GetMapping(value = "/details/{id}") |
||||
|
public AjaxResult detailsNotice(@PathVariable @ApiParam("主键id") Long id){ |
||||
|
log.debug("查询notice详情参数为:{}", id); |
||||
|
return AjaxResult.success(noticeService.queryDetails(id)); |
||||
|
} |
||||
|
|
||||
|
//@RequiresPermissions("system:config:list")
|
||||
|
@ApiOperation(value="变更type显示状态") |
||||
|
@PostMapping(value = "/changeStatus") |
||||
|
public AjaxResult changeStatus(@Validated @RequestBody @ApiParam("type状态对象") StatusDto dto){ |
||||
|
log.debug("变更type参数为:{}", JSON.toJSONString(dto)); |
||||
|
return AjaxResult.success(noticeService.changeStatus(dto.getId(),dto.getStatus())); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
package com.bnyer.img.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.*; |
||||
|
|
||||
|
@ApiModel(value="com-bnyer-img-domain-CreatorAccount") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_creator_account") |
||||
|
public class CreatorAccount extends BaseDomain { |
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 艺术家id |
||||
|
*/ |
||||
|
@TableField(value = "creator_id") |
||||
|
@ApiModelProperty(value="艺术家id") |
||||
|
private Long creatorId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名(加密) |
||||
|
*/ |
||||
|
@TableField(value = "name") |
||||
|
@ApiModelProperty(value="姓名(加密)") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 身份证(加密) |
||||
|
*/ |
||||
|
@TableField(value = "id_no") |
||||
|
@ApiModelProperty(value="身份证(加密)") |
||||
|
private String idNo; |
||||
|
|
||||
|
/** |
||||
|
* 银行卡(加密) |
||||
|
*/ |
||||
|
@TableField(value = "bank_no") |
||||
|
@ApiModelProperty(value="银行卡(加密)") |
||||
|
private String bankNo; |
||||
|
|
||||
|
/** |
||||
|
* 联系电话 |
||||
|
*/ |
||||
|
@TableField(value = "phone") |
||||
|
@ApiModelProperty(value="联系电话") |
||||
|
private String phone; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.bnyer.img.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.*; |
||||
|
|
||||
|
@ApiModel(value="com-bnyer-img-domain-DownloadLog") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_download_log") |
||||
|
public class DownloadLog extends BaseDomain { |
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.INPUT) |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 搜索码 |
||||
|
*/ |
||||
|
@TableField(value = "scan_code") |
||||
|
@ApiModelProperty(value="搜索码") |
||||
|
private String scanCode; |
||||
|
|
||||
|
/** |
||||
|
* 渠道(0->抖音;1->快手;2->微信) |
||||
|
*/ |
||||
|
@TableField(value = "channel") |
||||
|
@ApiModelProperty(value="渠道(0->抖音;1->快手;2->微信)") |
||||
|
private String channel; |
||||
|
|
||||
|
/** |
||||
|
* 图片id |
||||
|
*/ |
||||
|
@TableField(value = "img_id") |
||||
|
@ApiModelProperty(value="图片id") |
||||
|
private Long imgId; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
package com.bnyer.img.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
import lombok.ToString; |
||||
|
|
||||
|
@ApiModel(value="com-bnyer-img-domain-InviteLog") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_invite_log") |
||||
|
public class InviteLog extends BaseDomain { |
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 邀请码 |
||||
|
*/ |
||||
|
@TableField(value = "invite_code") |
||||
|
@ApiModelProperty(value="邀请码") |
||||
|
private String inviteCode; |
||||
|
|
||||
|
/** |
||||
|
* 被邀请者id |
||||
|
*/ |
||||
|
@TableField(value = "invited_creator_id") |
||||
|
@ApiModelProperty(value="被邀请者id") |
||||
|
private Long invitedCreatorId; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.bnyer.img.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.*; |
||||
|
|
||||
|
@ApiModel(value="com-bnyer-img-domain-Notice") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_notice") |
||||
|
public class Notice extends BaseDomain { |
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
@TableField(value = "title") |
||||
|
@ApiModelProperty(value="标题") |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
@TableField(value = "content") |
||||
|
@ApiModelProperty(value="内容") |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 渠道 |
||||
|
*/ |
||||
|
@TableField(value = "channel") |
||||
|
@ApiModelProperty(value="渠道") |
||||
|
private String channel; |
||||
|
|
||||
|
/** |
||||
|
* 图片 |
||||
|
*/ |
||||
|
@TableField(value = "img") |
||||
|
@ApiModelProperty(value="图片") |
||||
|
private String img; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.bnyer.img.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.*; |
||||
|
|
||||
|
@ApiModel(value="com-bnyer-img-domain-WithdrawLog") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_withdraw_log") |
||||
|
public class WithdrawLog extends BaseDomain { |
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* 艺术家id |
||||
|
*/ |
||||
|
@TableField(value = "creator_id") |
||||
|
@ApiModelProperty(value="艺术家id") |
||||
|
private Long creatorId; |
||||
|
|
||||
|
/** |
||||
|
* 提现金额 |
||||
|
*/ |
||||
|
@TableField(value = "amt") |
||||
|
@ApiModelProperty(value="提现金额") |
||||
|
private Integer amt; |
||||
|
|
||||
|
/** |
||||
|
* 银行卡(加密) |
||||
|
*/ |
||||
|
@TableField(value = "bank_no") |
||||
|
@ApiModelProperty(value="银行卡(加密)") |
||||
|
private String bankNo; |
||||
|
|
||||
|
/** |
||||
|
* 状态(0->提现失败;1->提现中;2->提现成功) |
||||
|
*/ |
||||
|
@TableField(value = "status") |
||||
|
@ApiModelProperty(value="状态(0->提现失败;1->提现中;2->提现成功)") |
||||
|
private String status; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.bnyer.img.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("分页参数接收类") |
||||
|
public class BasePageDto implements Serializable { |
||||
|
|
||||
|
@NotNull(message = "第几页不能为空!") |
||||
|
@ApiModelProperty(value="第几页") |
||||
|
private Integer pageNum; |
||||
|
|
||||
|
@NotNull(message = "每页条数不能为空!") |
||||
|
@ApiModelProperty(value="每页条数") |
||||
|
private Integer pageSize; |
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.bnyer.img.dto; |
||||
|
|
||||
|
import com.bnyer.common.core.utils.bean.BeanUtils; |
||||
|
import com.bnyer.img.domain.Notice; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("notice接收类") |
||||
|
public class NoticeDto implements Serializable { |
||||
|
|
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
@NotBlank(message = "标题不能为空!") |
||||
|
@ApiModelProperty(value="标题") |
||||
|
private String title; |
||||
|
|
||||
|
@NotBlank(message = "内容不能为空!") |
||||
|
@ApiModelProperty(value="内容") |
||||
|
private String content; |
||||
|
|
||||
|
@NotBlank(message = "渠道不能为空!") |
||||
|
@ApiModelProperty(value="渠道") |
||||
|
private String channel; |
||||
|
|
||||
|
@ApiModelProperty(value="图片") |
||||
|
private String img; |
||||
|
|
||||
|
public Notice extractParam(){ |
||||
|
Notice notice = new Notice(); |
||||
|
BeanUtils.copyProperties(this,notice); |
||||
|
return notice; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.bnyer.img.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("notice分页接收类") |
||||
|
public class NoticePageDto extends BasePageDto { |
||||
|
|
||||
|
@ApiModelProperty(value="banner名称") |
||||
|
private String title; |
||||
|
|
||||
|
@ApiModelProperty(value="渠道") |
||||
|
private String channel; |
||||
|
|
||||
|
@ApiModelProperty(value="是否显示") |
||||
|
private String isShow; |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.img.domain.CreatorAccount; |
||||
|
|
||||
|
public interface CreatorAccountMapper extends BaseMapper<CreatorAccount> { |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.img.domain.DownloadLog; |
||||
|
|
||||
|
public interface DownloadLogMapper extends BaseMapper<DownloadLog> { |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.img.domain.InviteLog; |
||||
|
|
||||
|
public interface InviteLogMapper extends BaseMapper<InviteLog> { |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.img.domain.Notice; |
||||
|
import com.bnyer.img.vo.NoticeVo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface NoticeMapper extends BaseMapper<Notice> { |
||||
|
/** |
||||
|
* 小程序查询公告列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
List<NoticeVo> queryList(); |
||||
|
|
||||
|
/** |
||||
|
* 小程序查询公告详情 |
||||
|
* @param id 主键id |
||||
|
* @return - |
||||
|
*/ |
||||
|
NoticeVo queryFrontDetails(Long id); |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.img.domain.WithdrawLog; |
||||
|
|
||||
|
public interface WithdrawLogMapper extends BaseMapper<WithdrawLog> { |
||||
|
} |
||||
@ -0,0 +1,67 @@ |
|||||
|
package com.bnyer.img.service; |
||||
|
|
||||
|
import com.bnyer.img.domain.Notice; |
||||
|
import com.bnyer.img.dto.NoticePageDto; |
||||
|
import com.bnyer.img.vo.NoticeVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface NoticeService { |
||||
|
|
||||
|
/** |
||||
|
* 新增notice |
||||
|
* @param notice - |
||||
|
* @return - |
||||
|
*/ |
||||
|
int insert(Notice notice); |
||||
|
|
||||
|
/** |
||||
|
* 修改notice |
||||
|
* @param notice - |
||||
|
* @return - |
||||
|
*/ |
||||
|
int update(Notice notice); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除notice |
||||
|
* @param ids ids |
||||
|
* @return - |
||||
|
*/ |
||||
|
int delete(List<Long> ids); |
||||
|
|
||||
|
/** |
||||
|
* 查询notice分页 |
||||
|
* @param dto 分页对象 |
||||
|
* @return - |
||||
|
*/ |
||||
|
List<Notice> queryPage(NoticePageDto dto); |
||||
|
|
||||
|
/** |
||||
|
* 查询notice详情 |
||||
|
* @param id 主键id |
||||
|
* @return - |
||||
|
*/ |
||||
|
Notice queryDetails(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询小程序notice列表 |
||||
|
* @return - |
||||
|
*/ |
||||
|
List<NoticeVo> queryList(); |
||||
|
|
||||
|
/** |
||||
|
* 查询小程序notice详情 |
||||
|
* @param id 主键id |
||||
|
* @return - |
||||
|
*/ |
||||
|
NoticeVo queryFrontDetails(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 变更显示状态 |
||||
|
* @param id 主键id |
||||
|
* @param status 状态 |
||||
|
* @return - |
||||
|
*/ |
||||
|
int changeStatus(Long id, String status); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
package com.bnyer.img.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
||||
|
import com.bnyer.common.core.utils.StringUtils; |
||||
|
import com.bnyer.img.domain.Notice; |
||||
|
import com.bnyer.img.dto.NoticePageDto; |
||||
|
import com.bnyer.img.mapper.NoticeMapper; |
||||
|
import com.bnyer.img.service.NoticeService; |
||||
|
import com.bnyer.img.vo.NoticeVo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class NoticeServiceImpl implements NoticeService { |
||||
|
|
||||
|
@Autowired |
||||
|
private NoticeMapper noticeMapper; |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int insert(Notice notice) { |
||||
|
notice.setCreateTime(new Date()); |
||||
|
notice.setUpdateTime(new Date()); |
||||
|
return noticeMapper.insert(notice); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int update(Notice notice) { |
||||
|
notice.setUpdateTime(new Date()); |
||||
|
return noticeMapper.updateById(notice); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int delete(List<Long> ids) { |
||||
|
return noticeMapper.deleteBatchIds(ids); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Notice> queryPage(NoticePageDto dto) { |
||||
|
LambdaQueryWrapper<Notice> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.like(StringUtils.isNotBlank(dto.getTitle()), Notice::getTitle,dto.getTitle()); |
||||
|
wrapper.eq(StringUtils.isNotBlank(dto.getChannel()), Notice::getChannel, dto.getChannel()); |
||||
|
wrapper.eq(StringUtils.isNotBlank(dto.getIsShow()), Notice::getIsShow, dto.getIsShow()); |
||||
|
wrapper.orderByDesc(Notice::getSort); |
||||
|
return noticeMapper.selectList(wrapper); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Notice queryDetails(Long id) { |
||||
|
return noticeMapper.selectById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<NoticeVo> queryList() { |
||||
|
return noticeMapper.queryList(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public NoticeVo queryFrontDetails(Long id) { |
||||
|
return noticeMapper.queryFrontDetails(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int changeStatus(Long id, String status) { |
||||
|
LambdaUpdateWrapper<Notice> wrapper = new LambdaUpdateWrapper<>(); |
||||
|
wrapper.eq(Notice::getId, id); |
||||
|
Notice notice = new Notice(); |
||||
|
notice.setIsShow(status); |
||||
|
return noticeMapper.update(notice,wrapper); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.bnyer.img.vo; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("公告响应体") |
||||
|
public class NoticeVo implements Serializable { |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
@ApiModelProperty(value="标题") |
||||
|
private String title; |
||||
|
|
||||
|
@ApiModelProperty(value="内容") |
||||
|
private String content; |
||||
|
|
||||
|
@ApiModelProperty(value="渠道") |
||||
|
private String channel; |
||||
|
|
||||
|
@ApiModelProperty(value="图片") |
||||
|
private String img; |
||||
|
|
||||
|
@ApiModelProperty(value="是否显示 (0->隐藏;1->显示)") |
||||
|
private String isShow; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@ApiModelProperty(value="创建时间") |
||||
|
private Date createTime; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.CreatorAccountMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.CreatorAccount"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_creator_account--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="id_no" jdbcType="VARCHAR" property="idNo" /> |
||||
|
<result column="bank_no" jdbcType="VARCHAR" property="bankNo" /> |
||||
|
<result column="phone" jdbcType="VARCHAR" property="phone" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!--@mbg.generated--> |
||||
|
id, creator_id, `name`, id_no, bank_no, phone, create_time, update_time, sort,is_show |
||||
|
</sql> |
||||
|
</mapper> |
||||
@ -0,0 +1,20 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.DownloadLogMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.DownloadLog"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_download_log--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="scan_code" jdbcType="VARCHAR" property="scanCode" /> |
||||
|
<result column="channel" jdbcType="CHAR" property="channel" /> |
||||
|
<result column="img_id" jdbcType="BIGINT" property="imgId" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!--@mbg.generated--> |
||||
|
id, scan_code, channel, img_id, create_time, update_time, sort,is_show |
||||
|
</sql> |
||||
|
</mapper> |
||||
@ -0,0 +1,19 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.InviteLogMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.InviteLog"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_invite_log--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="invite_code" jdbcType="VARCHAR" property="inviteCode" /> |
||||
|
<result column="invited_creator_id" jdbcType="BIGINT" property="invitedCreatorId" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!--@mbg.generated--> |
||||
|
id, invite_code, invited_creator_id, create_time, update_time,sort,is_show |
||||
|
</sql> |
||||
|
</mapper> |
||||
@ -0,0 +1,33 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.NoticeMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.Notice"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_notice--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="title" jdbcType="VARCHAR" property="title" /> |
||||
|
<result column="content" jdbcType="VARCHAR" property="content" /> |
||||
|
<result column="channel" jdbcType="VARCHAR" property="channel" /> |
||||
|
<result column="img" jdbcType="VARCHAR" property="img" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!--@mbg.generated--> |
||||
|
id, title, content, img, create_time, update_time, sort, channel,is_show |
||||
|
</sql> |
||||
|
<select id="queryList" resultType="com.bnyer.img.vo.NoticeVo"> |
||||
|
select |
||||
|
id, title, content, img, create_time,channel,is_show |
||||
|
from img_notice |
||||
|
where is_show = '1' and channel in ('0','3') |
||||
|
</select> |
||||
|
<select id="queryFrontDetails" resultType="com.bnyer.img.vo.NoticeVo"> |
||||
|
select |
||||
|
id, title, content, img, create_time,channel,is_show |
||||
|
from img_notice |
||||
|
where is_show = '1' and id = #{id} |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.WithdrawLogMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.WithdrawLog"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_withdraw_log--> |
||||
|
<id column="id" jdbcType="INTEGER" property="id" /> |
||||
|
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> |
||||
|
<result column="amt" jdbcType="INTEGER" property="amt" /> |
||||
|
<result column="bank_no" jdbcType="VARCHAR" property="bankNo" /> |
||||
|
<result column="status" jdbcType="CHAR" property="status" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!--@mbg.generated--> |
||||
|
id, creator_id, amt, bank_no, `status`, create_time, update_time, sort,is_show |
||||
|
</sql> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue