ソースを参照

音乐标签代码生成

weifanli 3 年 前
コミット
3db84642cb

+ 31 - 32
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/MusicTagController.java

@@ -1,6 +1,5 @@
 package com.yonge.cooleshow.admin.controller;
 
-import java.util.List;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import com.yonge.cooleshow.biz.dal.support.Condition;
@@ -20,66 +19,66 @@ import com.yonge.cooleshow.biz.dal.entity.MusicTag;
 import com.yonge.cooleshow.biz.dal.service.MusicTagService;
 
 @RestController
-@RequestMapping("/MusicTag")
+@RequestMapping("/musicTag")
 @Api(value = "音乐标签表", tags = "音乐标签表")
 public class MusicTagController extends BaseController {
 
-    @Autowired
-    private MusicTagService musicTagService;
+	@Autowired
+	private MusicTagService musicTagService;
 
 	/**
-     * 查询单条
-     */
-    @GetMapping("/detail/{id}")
-    @ApiOperation(value = "详情", notes = "传入musicTag")
-    public HttpResponseResult<MusicTagVo> detail(@PathVariable("id") Long id) {
-    	return succeed(musicTagService.detail(id));
+	 * 查询单条
+	 */
+	@GetMapping("/detail/{id}")
+	@ApiOperation(value = "详情", notes = "传入musicTag")
+	public HttpResponseResult<MusicTagVo> detail(@PathVariable("id") Long id) {
+		return succeed(musicTagService.detail(id));
 	}
-    
-    /**
-     * 查询分页
-     */
-    @GetMapping("/page")
-    @ApiOperation(value = "查询分页", notes = "传入musicTag")
-    public HttpResponseResult<PageInfo<MusicTagVo>> page(MusicTagSearch query) {
+
+	/**
+	 * 查询分页
+	 */
+	@GetMapping("/page")
+	@ApiOperation(value = "查询分页", notes = "传入musicTag")
+	public HttpResponseResult<PageInfo<MusicTagVo>> page(MusicTagSearch query) {
 		IPage<MusicTagVo> pages = musicTagService.selectPage(Condition.getPage(query), query);
-        return succeed(Condition.pageInfo(pages));
+		return succeed(Condition.pageInfo(pages));
 	}
-    
-    /**
+
+	/**
 	 * 新增
 	 */
 	@PostMapping("/save")
 	@ApiOperation(value = "新增", notes = "传入musicTag")
 	public HttpResponseResult save(@Valid @RequestBody MusicTag musicTag) {
-    	return status(musicTagService.save(musicTag));
+		return status(musicTagService.save(musicTag));
 	}
-    
-    /**
+
+	/**
 	 * 修改
 	 */
 	@PostMapping("/update")
 	@ApiOperation(value = "修改", notes = "传入musicTag")
 	public HttpResponseResult update(@Valid @RequestBody MusicTag musicTag) {
-        return status(musicTagService.updateById(musicTag));
+		return status(musicTagService.updateById(musicTag));
 	}
-    
-    /**
+
+	/**
 	 * 新增或修改
 	 */
-    @PostMapping("/submit")
-    @ApiOperation(value = "新增或修改", notes = "传入musicTag")
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入musicTag")
 	public HttpResponseResult submit(@RequestBody MusicTag musicTag) {
-        return status(musicTagService.saveOrUpdate(musicTag));
-    }
+		return status(musicTagService.saveOrUpdate(musicTag));
+	}
 
- 	/**
+	/**
 	 * 删除
 	 */
 	@PostMapping("/remove")
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        if (StringUtil.isEmpty(ids)) {
+		if (StringUtil.isEmpty(ids)) {
 			return failed("参数不能为空");
 		}
 		return status(musicTagService.removeByIds(StringUtil.toLongList(ids)));

+ 54 - 18
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicTag.java

@@ -18,73 +18,109 @@ import org.springframework.format.annotation.DateTimeFormat;
 @TableName("music_tag")
 @ApiModel(value = "MusicTag对象", description = "音乐标签表")
 public class MusicTag implements Serializable {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
     @ApiModelProperty("标签id ")
     @TableId(value = "id_", type = IdType.AUTO)
     private Integer id;
     @ApiModelProperty("父级标签id ")
-	@TableField(value = "parent_tag_id_")
+    @TableField(value = "parent_tag_id_")
     private Integer parentTagId;
     @ApiModelProperty("标签名称 ")
-	@TableField(value = "name_")
+    @TableField(value = "name_")
     private String name;
-	@TableField(value = "del_flag_")
+    @ApiModelProperty("标签状态(0:启用,1:禁用) ")
+    @TableField(value = "state_")
+    private Integer state;
+    @ApiModelProperty("假删标识(0:正常,1:删除) ")
+    @TableField(value = "del_flag_")
     private Byte delFlag;
-	@TableField(value = "create_time_")
+    @ApiModelProperty("创建时间 ")
+    @TableField(value = "create_time_")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date createTime;
-	@TableField(value = "update_time_")
+    @ApiModelProperty("更新时间 ")
+    @TableField(value = "update_time_")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date updateTime;
+    @ApiModelProperty("更新人(后台平台用户) ")
+    @TableField(value = "update_by_")
+    private Integer updateBy;
+    @ApiModelProperty("创建人(后台平台用户) ")
+    @TableField(value = "create_by_")
+    private Integer createBy;
 
-	public Integer getId() {
+    public Integer getId() {
         return id;
     }
 
     public void setId(Integer id) {
         this.id = id;
     }
-    
-	public Integer getParentTagId() {
+
+    public Integer getParentTagId() {
         return parentTagId;
     }
 
     public void setParentTagId(Integer parentTagId) {
         this.parentTagId = parentTagId;
     }
-    
-	public String getName() {
+
+    public String getName() {
         return name;
     }
 
     public void setName(String name) {
         this.name = name;
     }
-    
-	public Byte getDelFlag() {
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Byte getDelFlag() {
         return delFlag;
     }
 
     public void setDelFlag(Byte delFlag) {
         this.delFlag = delFlag;
     }
-    
-	public Date getCreateTime() {
+
+    public Date getCreateTime() {
         return createTime;
     }
 
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-    
-	public Date getUpdateTime() {
+
+    public Date getUpdateTime() {
         return updateTime;
     }
 
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
-    
+
+    public Integer getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(Integer updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Integer getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(Integer createBy) {
+        this.createBy = createBy;
+    }
+
 }

+ 23 - 17
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicTagMapper.xml

@@ -1,35 +1,41 @@
 <?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.yonge.cooleshow.biz.dal.dao.MusicTagDao">
-	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.MusicTag">
-            <result column="id_" property="id" />
-	        <result column="parent_tag_id_" property="parentTagId" />
-	        <result column="name_" property="name" />
-	        <result column="del_flag_" property="delFlag" />
-	        <result column="create_time_" property="createTime" />
-	        <result column="update_time_" property="updateTime" />
-		</resultMap>  
-    
+    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.MusicTag">
+        <result column="id_" property="id" />
+        <result column="parent_tag_id_" property="parentTagId" />
+        <result column="name_" property="name" />
+        <result column="state_" property="state" />
+        <result column="del_flag_" property="delFlag" />
+        <result column="create_time_" property="createTime" />
+        <result column="update_time_" property="updateTime" />
+        <result column="update_by_" property="updateBy" />
+        <result column="create_by_" property="createBy" />
+    </resultMap>
+
     <!-- 表字段 -->
     <sql id="baseColumns">
          t.id_
         , t.parent_tag_id_
         , t.name_
+        , t.state_
         , t.del_flag_
         , t.create_time_
         , t.update_time_
-        </sql> 
-    
+        , t.update_by_
+        , t.create_by_
+        </sql>
+
     <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.MusicTagVo">
         SELECT
-            <include refid="baseColumns"/>
+        <include refid="baseColumns"/>
         FROM music_tag t
         where t.id_ = #{id}
     </select>
-    
+
     <select id="selectPage" resultMap="BaseResultMap">
-		SELECT         
-        	<include refid="baseColumns" />
-		FROM music_tag t
-	</select>
+        SELECT
+        <include refid="baseColumns" />
+        FROM music_tag t
+    </select>
 </mapper>