添加作者表
This commit is contained in:
parent
ba18423232
commit
4e2938eee3
@ -0,0 +1,88 @@
|
|||||||
|
package com.dd.admin.business.author.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import com.dd.admin.common.model.UpdateGroup;
|
||||||
|
import com.dd.admin.common.model.result.ResultBean;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.dd.admin.business.author.entity.Author;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorVo;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorDto;
|
||||||
|
import com.dd.admin.business.author.service.AuthorService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主) 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Api(tags = "作者(博主)")
|
||||||
|
@RestController
|
||||||
|
public class AuthorController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AuthorService authorService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-分页列表")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping("/admin/author/page")
|
||||||
|
public ResultBean<IPage<AuthorVo>> page(AuthorDto authorDto) {
|
||||||
|
IPage<AuthorVo> pageInfo = authorService.selectAuthorPage(authorDto);
|
||||||
|
return ResultBean.success(pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-列表")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@GetMapping("/admin/author/list")
|
||||||
|
public ResultBean<List<AuthorVo>> list(AuthorDto authorDto) {
|
||||||
|
List<AuthorVo> list = authorService.selectAuthorList(authorDto);
|
||||||
|
return ResultBean.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-添加")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@PostMapping("/admin/author/add")
|
||||||
|
public ResultBean<Author> add(@RequestBody @Validated AuthorDto authorDto) {
|
||||||
|
Author author = BeanUtil.copyProperties(authorDto, Author.class);
|
||||||
|
authorService.save(author);
|
||||||
|
return ResultBean.success(author);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-查询")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@GetMapping("/admin/author/{authorId}")
|
||||||
|
public ResultBean<AuthorVo> get(@PathVariable @NotBlank String authorId) {
|
||||||
|
Author author = authorService.getById(authorId);
|
||||||
|
AuthorVo authorVo = BeanUtil.copyProperties(author,AuthorVo.class);
|
||||||
|
return ResultBean.success(authorVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-修改")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@PostMapping("/admin/author/update")
|
||||||
|
public ResultBean<Author> update(@RequestBody @Validated(UpdateGroup.class) AuthorDto authorDto) {
|
||||||
|
Author author = BeanUtil.copyProperties(authorDto, Author.class);
|
||||||
|
authorService.updateById(author);
|
||||||
|
return ResultBean.success(author);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "作者(博主)-删除")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@GetMapping("/admin/author/delete/{authorId}")
|
||||||
|
public ResultBean<Author> delete(@PathVariable @NotBlank String authorId) {
|
||||||
|
Boolean b = authorService.removeById(authorId);
|
||||||
|
return ResultBean.success(b);
|
||||||
|
}
|
||||||
|
}
|
116
src/main/java/com/dd/admin/business/author/domain/AuthorDto.java
Normal file
116
src/main/java/com/dd/admin/business/author/domain/AuthorDto.java
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
package com.dd.admin.business.author.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.Version;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.dd.admin.common.model.UpdateGroup;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主)返回对象
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value="作者(博主)接收对象")
|
||||||
|
public class AuthorDto {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者id")
|
||||||
|
@NotBlank(message = "作者(博主)id不能为空",groups = UpdateGroup.class)
|
||||||
|
private String authorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者号")
|
||||||
|
private String authorNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者姓名")
|
||||||
|
private String authorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像id")
|
||||||
|
private String avatarId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "简介")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生日")
|
||||||
|
private Date birth;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职业")
|
||||||
|
private String job;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "地区")
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "学校")
|
||||||
|
private String school;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图")
|
||||||
|
private String backGroundId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图地址")
|
||||||
|
private String backGroundUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关注数")
|
||||||
|
private Long follow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数")
|
||||||
|
private Long fans;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点赞数")
|
||||||
|
private Long upCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "收藏数")
|
||||||
|
private Long starCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常")
|
||||||
|
private Integer authorStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "乐观锁字段")
|
||||||
|
private Long version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常 1删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ip地址")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实ip地址")
|
||||||
|
private String ipRealAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
112
src/main/java/com/dd/admin/business/author/domain/AuthorVo.java
Normal file
112
src/main/java/com/dd/admin/business/author/domain/AuthorVo.java
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
package com.dd.admin.business.author.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.Version;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主)返回对象
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value="作者(博主)返回对象")
|
||||||
|
public class AuthorVo {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者id")
|
||||||
|
private String authorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者号")
|
||||||
|
private String authorNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者姓名")
|
||||||
|
private String authorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像id")
|
||||||
|
private String avatarId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "简介")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生日")
|
||||||
|
private Date birth;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职业")
|
||||||
|
private String job;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "地区")
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "学校")
|
||||||
|
private String school;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图")
|
||||||
|
private String backGroundId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图地址")
|
||||||
|
private String backGroundUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关注数")
|
||||||
|
private Long follow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数")
|
||||||
|
private Long fans;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点赞数")
|
||||||
|
private Long upCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "收藏数")
|
||||||
|
private Long starCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常")
|
||||||
|
private Integer authorStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "乐观锁字段")
|
||||||
|
private Long version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常 1删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ip地址")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实ip地址")
|
||||||
|
private String ipRealAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
144
src/main/java/com/dd/admin/business/author/entity/Author.java
Normal file
144
src/main/java/com/dd/admin/business/author/entity/Author.java
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
package com.dd.admin.business.author.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.Version;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主)
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("business_author")
|
||||||
|
@ApiModel(value="Author对象", description="作者(博主)")
|
||||||
|
public class Author implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者id")
|
||||||
|
@TableId(value = "AUTHOR_ID", type = IdType.ASSIGN_UUID)
|
||||||
|
private String authorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者号")
|
||||||
|
@TableField("AUTHOR_NO")
|
||||||
|
private String authorNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者姓名")
|
||||||
|
@TableField("AUTHOR_NAME")
|
||||||
|
private String authorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像id")
|
||||||
|
@TableField("AVATAR_ID")
|
||||||
|
private String avatarId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
@TableField("AVATAR_URL")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "简介")
|
||||||
|
@TableField("DESCRIPTION")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别")
|
||||||
|
@TableField("SEX")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生日")
|
||||||
|
@TableField("BIRTH")
|
||||||
|
private Date birth;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职业")
|
||||||
|
@TableField("JOB")
|
||||||
|
private String job;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "地区")
|
||||||
|
@TableField("AREA")
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "学校")
|
||||||
|
@TableField("SCHOOL")
|
||||||
|
private String school;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图")
|
||||||
|
@TableField("BACK_GROUND_ID")
|
||||||
|
private String backGroundId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图地址")
|
||||||
|
@TableField("BACK_GROUND_URL")
|
||||||
|
private String backGroundUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关注数")
|
||||||
|
@TableField("FOLLOW")
|
||||||
|
private Long follow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数")
|
||||||
|
@TableField("FANS")
|
||||||
|
private Long fans;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点赞数")
|
||||||
|
@TableField("UP_COUNT")
|
||||||
|
private Long upCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "收藏数")
|
||||||
|
@TableField("STAR_COUNT")
|
||||||
|
private Long starCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常")
|
||||||
|
@TableField("AUTHOR_STATUS")
|
||||||
|
private Integer authorStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "乐观锁字段")
|
||||||
|
@TableField("VERSION")
|
||||||
|
@Version
|
||||||
|
private Long version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0正常 1删除")
|
||||||
|
@TableField("DELETED")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ip地址")
|
||||||
|
@TableField("IP_ADDRESS")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实ip地址")
|
||||||
|
@TableField("IP_REAL_ADDRESS")
|
||||||
|
private String ipRealAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "真实姓名")
|
||||||
|
@TableField("REAL_NAME")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
@TableField("ID_CARD")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
@TableField("PHONE_NUMBER")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.dd.admin.business.author.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.dd.admin.business.author.entity.Author;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorVo;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主) Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthorMapper extends BaseMapper<Author> {
|
||||||
|
|
||||||
|
IPage<AuthorVo> selectAuthorPage(Page<AuthorVo> page, @Param("authorDto") AuthorDto authorDto);
|
||||||
|
|
||||||
|
List<AuthorVo> selectAuthorList(@Param("authorDto") AuthorDto authorDto);
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
<?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.dd.admin.business.author.mapper.AuthorMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.dd.admin.business.author.entity.Author">
|
||||||
|
<id column="AUTHOR_ID" property="authorId" />
|
||||||
|
<result column="AUTHOR_NO" property="authorNo" />
|
||||||
|
<result column="AUTHOR_NAME" property="authorName" />
|
||||||
|
<result column="AVATAR_ID" property="avatarId" />
|
||||||
|
<result column="AVATAR_URL" property="avatarUrl" />
|
||||||
|
<result column="DESCRIPTION" property="description" />
|
||||||
|
<result column="SEX" property="sex" />
|
||||||
|
<result column="BIRTH" property="birth" />
|
||||||
|
<result column="JOB" property="job" />
|
||||||
|
<result column="AREA" property="area" />
|
||||||
|
<result column="SCHOOL" property="school" />
|
||||||
|
<result column="BACK_GROUND_ID" property="backGroundId" />
|
||||||
|
<result column="BACK_GROUND_URL" property="backGroundUrl" />
|
||||||
|
<result column="FOLLOW" property="follow" />
|
||||||
|
<result column="FANS" property="fans" />
|
||||||
|
<result column="UP_COUNT" property="upCount" />
|
||||||
|
<result column="STAR_COUNT" property="starCount" />
|
||||||
|
<result column="AUTHOR_STATUS" property="authorStatus" />
|
||||||
|
<result column="VERSION" property="version" />
|
||||||
|
<result column="DELETED" property="deleted" />
|
||||||
|
<result column="CREATE_TIME" property="createTime" />
|
||||||
|
<result column="UPDATE_TIME" property="updateTime" />
|
||||||
|
<result column="IP_ADDRESS" property="ipAddress" />
|
||||||
|
<result column="IP_REAL_ADDRESS" property="ipRealAddress" />
|
||||||
|
<result column="REAL_NAME" property="realName" />
|
||||||
|
<result column="ID_CARD" property="idCard" />
|
||||||
|
<result column="PHONE_NUMBER" property="phoneNumber" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
AUTHOR_ID, AUTHOR_NO, AUTHOR_NAME, AVATAR_ID, AVATAR_URL, DESCRIPTION, SEX, BIRTH, JOB, AREA, SCHOOL, BACK_GROUND_ID, BACK_GROUND_URL, FOLLOW, FANS, UP_COUNT, STAR_COUNT, AUTHOR_STATUS, VERSION, DELETED, CREATE_TIME, UPDATE_TIME, IP_ADDRESS, IP_REAL_ADDRESS, REAL_NAME, ID_CARD, PHONE_NUMBER
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAuthorPage" resultType="com.dd.admin.business.author.domain.AuthorVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from business_author where 1 = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAuthorList" resultType="com.dd.admin.business.author.domain.AuthorVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from business_author where 1 = 1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.dd.admin.business.author.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.dd.admin.business.author.entity.Author;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorVo;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorDto;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主) 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
public interface AuthorService extends IService<Author> {
|
||||||
|
|
||||||
|
//作者(博主)-分页列表
|
||||||
|
IPage<AuthorVo> selectAuthorPage(AuthorDto authorDto);
|
||||||
|
|
||||||
|
//作者(博主)-列表
|
||||||
|
List<AuthorVo> selectAuthorList(AuthorDto authorDto);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.dd.admin.business.author.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.dd.admin.common.model.PageFactory;
|
||||||
|
import com.dd.admin.business.author.entity.Author;
|
||||||
|
import com.dd.admin.business.author.mapper.AuthorMapper;
|
||||||
|
import com.dd.admin.business.author.service.AuthorService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorVo;
|
||||||
|
import com.dd.admin.business.author.domain.AuthorDto;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 作者(博主) 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 727869402@qq.com
|
||||||
|
* @since 2024-12-12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AuthorServiceImpl extends ServiceImpl<AuthorMapper, Author> implements AuthorService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<AuthorVo> selectAuthorPage(AuthorDto authorDto) {
|
||||||
|
Page page = PageFactory.defaultPage();
|
||||||
|
return baseMapper.selectAuthorPage(page,authorDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AuthorVo> selectAuthorList(AuthorDto authorDto) {
|
||||||
|
return baseMapper.selectAuthorList(authorDto);
|
||||||
|
}
|
||||||
|
}
|
@ -75,9 +75,9 @@ public class BusinessGenerator {
|
|||||||
|
|
||||||
// 数据源配置
|
// 数据源配置
|
||||||
DataSourceConfig dsc = new DataSourceConfig();
|
DataSourceConfig dsc = new DataSourceConfig();
|
||||||
dsc.setUrl("jdbc:mysql://127.0.0.1:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8");
|
dsc.setUrl("jdbc:mysql://8.146.211.120:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8");
|
||||||
dsc.setUsername("root");
|
dsc.setUsername("root");
|
||||||
dsc.setPassword("admin");
|
dsc.setPassword("wxlwxl12");
|
||||||
|
|
||||||
// dsc.setSchemaName("public");
|
// dsc.setSchemaName("public");
|
||||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||||
|
41
web/src/api/business/author/author.js
Normal file
41
web/src/api/business/author/author.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getAuthorPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/author/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAuthorList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/author/list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addAuthor(data) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/author/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editAuthor(data) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/author/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteAuthor(authorId) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/author/delete/' + authorId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
211
web/src/views/business/author/addAuthor.vue
Normal file
211
web/src/views/business/author/addAuthor.vue
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
top="8vh"
|
||||||
|
width="40%"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
center
|
||||||
|
@close="handleCancel"
|
||||||
|
>
|
||||||
|
<div class="el-dialog-div">
|
||||||
|
<el-form
|
||||||
|
:rules="rules"
|
||||||
|
ref="dataForm"
|
||||||
|
:model="temp"
|
||||||
|
label-position="right"
|
||||||
|
label-width="120px"
|
||||||
|
style="height: 90%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="作者id" prop="authorId" class="is-required">
|
||||||
|
<el-input v-model="temp.authorId" placeholder="作者id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者号" prop="authorNo" class="is-required">
|
||||||
|
<el-input v-model="temp.authorNo" placeholder="作者号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者姓名" prop="authorName" class="is-required">
|
||||||
|
<el-input v-model="temp.authorName" placeholder="作者姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像id" prop="avatarId" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarId" placeholder="头像id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像地址" prop="avatarUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarUrl" placeholder="头像地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="简介" prop="description" class="is-required">
|
||||||
|
<el-input v-model="temp.description" placeholder="简介" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别" prop="sex" class="is-required">
|
||||||
|
<el-input v-model="temp.sex" placeholder="性别" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="生日" prop="birth" class="is-required">
|
||||||
|
<el-input v-model="temp.birth" placeholder="生日" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="职业" prop="job" class="is-required">
|
||||||
|
<el-input v-model="temp.job" placeholder="职业" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="地区" prop="area" class="is-required">
|
||||||
|
<el-input v-model="temp.area" placeholder="地区" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="学校" prop="school" class="is-required">
|
||||||
|
<el-input v-model="temp.school" placeholder="学校" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="背景图" prop="backGroundId" class="is-required">
|
||||||
|
<el-input v-model="temp.backGroundId" placeholder="背景图" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="背景图地址" prop="backGroundUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.backGroundUrl" placeholder="背景图地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="关注数" prop="follow" class="is-required">
|
||||||
|
<el-input v-model="temp.follow" placeholder="关注数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="粉丝数" prop="fans" class="is-required">
|
||||||
|
<el-input v-model="temp.fans" placeholder="粉丝数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="点赞数" prop="upCount" class="is-required">
|
||||||
|
<el-input v-model="temp.upCount" placeholder="点赞数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="收藏数" prop="starCount" class="is-required">
|
||||||
|
<el-input v-model="temp.starCount" placeholder="收藏数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常" prop="authorStatus" class="is-required">
|
||||||
|
<el-input v-model="temp.authorStatus" placeholder="0正常" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="乐观锁字段" prop="version" class="is-required">
|
||||||
|
<el-input v-model="temp.version" placeholder="乐观锁字段" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||||
|
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||||
|
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="修改时间" prop="updateTime" class="is-required">
|
||||||
|
<el-input v-model="temp.updateTime" placeholder="修改时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="ip地址" prop="ipAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipAddress" placeholder="ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实ip地址" prop="ipRealAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipRealAddress" placeholder="真实ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实姓名" prop="realName" class="is-required">
|
||||||
|
<el-input v-model="temp.realName" placeholder="真实姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="身份证号" prop="idCard" class="is-required">
|
||||||
|
<el-input v-model="temp.idCard" placeholder="身份证号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="手机号" prop="phoneNumber" class="is-required">
|
||||||
|
<el-input v-model="temp.phoneNumber" placeholder="手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleCancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {addAuthor} from "@/api/business/author/author";
|
||||||
|
import {setRequiredFields} from "@/utils";
|
||||||
|
const requiredFields = []
|
||||||
|
export default {
|
||||||
|
name: "addForm",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
rules: setRequiredFields(requiredFields),
|
||||||
|
dialogVisible: false,
|
||||||
|
temp: {
|
||||||
|
authorId:'',
|
||||||
|
authorNo:'',
|
||||||
|
authorName:'',
|
||||||
|
avatarId:'',
|
||||||
|
avatarUrl:'',
|
||||||
|
description:'',
|
||||||
|
sex:'',
|
||||||
|
birth:'',
|
||||||
|
job:'',
|
||||||
|
area:'',
|
||||||
|
school:'',
|
||||||
|
backGroundId:'',
|
||||||
|
backGroundUrl:'',
|
||||||
|
follow:'',
|
||||||
|
fans:'',
|
||||||
|
upCount:'',
|
||||||
|
starCount:'',
|
||||||
|
authorStatus:'',
|
||||||
|
version:'',
|
||||||
|
deleted:'',
|
||||||
|
createTime:'',
|
||||||
|
updateTime:'',
|
||||||
|
ipAddress:'',
|
||||||
|
ipRealAddress:'',
|
||||||
|
realName:'',
|
||||||
|
idCard:'',
|
||||||
|
phoneNumber:'',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
addAuthor(this.temp).then(response =>{
|
||||||
|
this.handleCancel()
|
||||||
|
this.$emit('ok', response.data)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
//初始化
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
453
web/src/views/business/author/authorList.vue
Normal file
453
web/src/views/business/author/authorList.vue
Normal file
@ -0,0 +1,453 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
|
||||||
|
<div class="filter-container">
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.keyword"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
clearable
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;margin-left: 10px;"
|
||||||
|
/>
|
||||||
|
<el-button-group style="margin-left: 10px;">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="search"
|
||||||
|
>
|
||||||
|
搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="refresh"
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
style="margin-left: 10px;"
|
||||||
|
@click="add"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
height="100%"
|
||||||
|
class="table-container"
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
width="150"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.$index+1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="作者id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="作者号"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorNo }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="作者姓名"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="头像id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.avatarId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="头像地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.avatarUrl }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="简介"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.description }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="性别"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.sex }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="生日"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.birth }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="职业"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.job }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="地区"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.area }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="学校"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.school }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="背景图"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.backGroundId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="背景图地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.backGroundUrl }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="关注数"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.follow }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="粉丝数"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.fans }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="点赞数"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.upCount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="收藏数"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.starCount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="0正常"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorStatus }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="乐观锁字段"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.version }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="0正常 1删除"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.deleted }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.createTime }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="修改时间"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.updateTime }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="ip地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.ipAddress }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="真实ip地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.ipRealAddress }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="真实姓名"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.realName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="身份证号"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.idCard }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="手机号"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.phoneNumber }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
@click="edit(scope)"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
@click="del(scope)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
:total="total"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.limit"
|
||||||
|
@pagination="fetchData"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<add-form ref="addForm" @ok="addOk" />
|
||||||
|
<edit-form ref="editForm" @ok="editOk" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getAuthorPage,deleteAuthor} from "@/api/business/author/author";
|
||||||
|
import {deepClone,success} from "@/utils";
|
||||||
|
|
||||||
|
import confirm from "@/utils/confirm";
|
||||||
|
import Pagination from '@/components/Pagination'
|
||||||
|
import addForm from "@/views/business/author/addAuthor";
|
||||||
|
import editForm from "@/views/business/author/editAuthor";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'author',
|
||||||
|
components: {addForm,editForm,Pagination},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
limit: 50,
|
||||||
|
keyword: ''
|
||||||
|
},
|
||||||
|
temp: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.listQuery = this.$options.data().listQuery
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getAuthorPage(this.listQuery).then(response => {
|
||||||
|
const { records, total } = response.data
|
||||||
|
this.list = records
|
||||||
|
this.total = total
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
this.$refs.addForm.open()
|
||||||
|
},
|
||||||
|
addOk(){
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
edit(scope) {
|
||||||
|
const temp = deepClone(scope.row)
|
||||||
|
this.$refs.editForm.open(temp)
|
||||||
|
},
|
||||||
|
editOk(){
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
del(scope) {
|
||||||
|
confirm("确定要删除吗?").then(res=>{
|
||||||
|
if(res){
|
||||||
|
deleteAuthor(scope.row.authorId).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
success('删除成功')
|
||||||
|
this.fetchData()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
212
web/src/views/business/author/editAuthor.vue
Normal file
212
web/src/views/business/author/editAuthor.vue
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
top="8vh"
|
||||||
|
width="40%"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
center
|
||||||
|
@close="handleCancel"
|
||||||
|
>
|
||||||
|
<div class="el-dialog-div">
|
||||||
|
<el-form
|
||||||
|
:rules="rules"
|
||||||
|
ref="dataForm"
|
||||||
|
:model="temp"
|
||||||
|
label-position="right"
|
||||||
|
label-width="120px"
|
||||||
|
style="height: 90%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="作者id" prop="authorId" class="is-required">
|
||||||
|
<el-input v-model="temp.authorId" placeholder="作者id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者号" prop="authorNo" class="is-required">
|
||||||
|
<el-input v-model="temp.authorNo" placeholder="作者号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者姓名" prop="authorName" class="is-required">
|
||||||
|
<el-input v-model="temp.authorName" placeholder="作者姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像id" prop="avatarId" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarId" placeholder="头像id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像地址" prop="avatarUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarUrl" placeholder="头像地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="简介" prop="description" class="is-required">
|
||||||
|
<el-input v-model="temp.description" placeholder="简介" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别" prop="sex" class="is-required">
|
||||||
|
<el-input v-model="temp.sex" placeholder="性别" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="生日" prop="birth" class="is-required">
|
||||||
|
<el-input v-model="temp.birth" placeholder="生日" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="职业" prop="job" class="is-required">
|
||||||
|
<el-input v-model="temp.job" placeholder="职业" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="地区" prop="area" class="is-required">
|
||||||
|
<el-input v-model="temp.area" placeholder="地区" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="学校" prop="school" class="is-required">
|
||||||
|
<el-input v-model="temp.school" placeholder="学校" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="背景图" prop="backGroundId" class="is-required">
|
||||||
|
<el-input v-model="temp.backGroundId" placeholder="背景图" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="背景图地址" prop="backGroundUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.backGroundUrl" placeholder="背景图地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="关注数" prop="follow" class="is-required">
|
||||||
|
<el-input v-model="temp.follow" placeholder="关注数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="粉丝数" prop="fans" class="is-required">
|
||||||
|
<el-input v-model="temp.fans" placeholder="粉丝数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="点赞数" prop="upCount" class="is-required">
|
||||||
|
<el-input v-model="temp.upCount" placeholder="点赞数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="收藏数" prop="starCount" class="is-required">
|
||||||
|
<el-input v-model="temp.starCount" placeholder="收藏数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常" prop="authorStatus" class="is-required">
|
||||||
|
<el-input v-model="temp.authorStatus" placeholder="0正常" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="乐观锁字段" prop="version" class="is-required">
|
||||||
|
<el-input v-model="temp.version" placeholder="乐观锁字段" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||||
|
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||||
|
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="修改时间" prop="updateTime" class="is-required">
|
||||||
|
<el-input v-model="temp.updateTime" placeholder="修改时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="ip地址" prop="ipAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipAddress" placeholder="ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实ip地址" prop="ipRealAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipRealAddress" placeholder="真实ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实姓名" prop="realName" class="is-required">
|
||||||
|
<el-input v-model="temp.realName" placeholder="真实姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="身份证号" prop="idCard" class="is-required">
|
||||||
|
<el-input v-model="temp.idCard" placeholder="身份证号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="手机号" prop="phoneNumber" class="is-required">
|
||||||
|
<el-input v-model="temp.phoneNumber" placeholder="手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleCancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { editAuthor } from "@/api/business/author/author";
|
||||||
|
import {setRequiredFields} from "@/utils";
|
||||||
|
const requiredFields = []
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "editForm",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
rules: setRequiredFields(requiredFields),
|
||||||
|
dialogVisible: false,
|
||||||
|
temp: {
|
||||||
|
authorId:'',
|
||||||
|
authorNo:'',
|
||||||
|
authorName:'',
|
||||||
|
avatarId:'',
|
||||||
|
avatarUrl:'',
|
||||||
|
description:'',
|
||||||
|
sex:'',
|
||||||
|
birth:'',
|
||||||
|
job:'',
|
||||||
|
area:'',
|
||||||
|
school:'',
|
||||||
|
backGroundId:'',
|
||||||
|
backGroundUrl:'',
|
||||||
|
follow:'',
|
||||||
|
fans:'',
|
||||||
|
upCount:'',
|
||||||
|
starCount:'',
|
||||||
|
authorStatus:'',
|
||||||
|
version:'',
|
||||||
|
deleted:'',
|
||||||
|
createTime:'',
|
||||||
|
updateTime:'',
|
||||||
|
ipAddress:'',
|
||||||
|
ipRealAddress:'',
|
||||||
|
realName:'',
|
||||||
|
idCard:'',
|
||||||
|
phoneNumber:'',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(row) {
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.temp = row
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
editAuthor(this.temp).then(response => {
|
||||||
|
this.handleCancel()
|
||||||
|
this.$emit('ok', response.data)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
//初始化
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$refs['dataForm'].resetFields()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user