edit
This commit is contained in:
@@ -8,51 +8,10 @@ import lombok.Data;
|
||||
* 问题反馈
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class Bug {
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getBugRemark() {
|
||||
return bugRemark;
|
||||
}
|
||||
|
||||
public void setBugRemark(String bugRemark) {
|
||||
this.bugRemark = bugRemark;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String product;
|
||||
@@ -62,4 +21,6 @@ public class Bug {
|
||||
private String createBy;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
private String answer;
|
||||
}
|
||||
|
||||
@@ -54,13 +54,21 @@ public class BugController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
* 添加
|
||||
*/
|
||||
@RequestMapping("/addBug")
|
||||
public Msg addBug(Bug bug, HttpSession session) {
|
||||
return bugService.addBug(bug, session);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@RequestMapping("/updateBug")
|
||||
public Msg updateBug(Bug bug, HttpSession session) {
|
||||
return bugService.updateBug(bug);
|
||||
}
|
||||
|
||||
// 图片上传及新增
|
||||
@RequestMapping("/bugUpload")
|
||||
public Msg upload(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
@@ -82,7 +90,6 @@ public class BugController {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param prefixSelf 根据上传的接口存入自己的文件夹
|
||||
* @param suffix 文件的后缀
|
||||
* @param fileName 文件名
|
||||
|
||||
@@ -9,4 +9,6 @@ public interface BugMapper {
|
||||
List<Bug> getBugs(Bug bug);
|
||||
|
||||
int addBug(Bug bug);
|
||||
|
||||
int updateBug(Bug bug);
|
||||
}
|
||||
|
||||
@@ -32,4 +32,12 @@ public class BugService {
|
||||
return Msg.success();
|
||||
}
|
||||
|
||||
public Msg updateBug(Bug bug) {
|
||||
int i = bugMapper.updateBug(bug);
|
||||
if (i < 0) {
|
||||
return Msg.fail();
|
||||
}
|
||||
return Msg.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?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="lingtao.net.dao.BugMapper">
|
||||
|
||||
<select id="getBugs" parameterType="Bug" resultType="Bug">
|
||||
SELECT
|
||||
*
|
||||
@@ -18,20 +17,20 @@
|
||||
|
||||
<insert id="addBug" parameterType="Bug">
|
||||
INSERT INTO bug
|
||||
(
|
||||
id,
|
||||
(id,
|
||||
product,
|
||||
bugRemark,
|
||||
createBy,
|
||||
createDate
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
NULL,
|
||||
createDate)
|
||||
VALUES (NULL,
|
||||
#{product},
|
||||
#{bugRemark},
|
||||
#{createBy},
|
||||
now()
|
||||
)
|
||||
now())
|
||||
</insert>
|
||||
<update id="updateBug" parameterType="Bug">
|
||||
update bug
|
||||
set answer = #{answer}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user