Commit 5f111377d59dd67330f6de52aede6d90c2184757
1 parent
58c6942b
增加数美审核图文的页面
Showing
4 changed files
with
48 additions
and
2 deletions
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -14,6 +14,9 @@ import org.slf4j.Logger; | @@ -14,6 +14,9 @@ import org.slf4j.Logger; | ||
| 14 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | import org.springframework.stereotype.Controller; | 16 | import org.springframework.stereotype.Controller; |
| 17 | +import org.springframework.ui.Model; | ||
| 18 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 19 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 17 | import org.springframework.web.bind.annotation.PostMapping; | 20 | import org.springframework.web.bind.annotation.PostMapping; |
| 18 | import org.springframework.web.bind.annotation.RequestBody; | 21 | import org.springframework.web.bind.annotation.RequestBody; |
| 19 | import org.springframework.web.bind.annotation.RequestMapping; | 22 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -22,6 +25,8 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -22,6 +25,8 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 22 | import java.util.Date; | 25 | import java.util.Date; |
| 23 | import java.util.List; | 26 | import java.util.List; |
| 24 | 27 | ||
| 28 | +import javax.servlet.http.HttpSession; | ||
| 29 | + | ||
| 25 | @Controller | 30 | @Controller |
| 26 | @RequestMapping("/api/content") | 31 | @RequestMapping("/api/content") |
| 27 | public class ContentControllerApi { | 32 | public class ContentControllerApi { |
| @@ -189,5 +194,14 @@ public class ContentControllerApi { | @@ -189,5 +194,14 @@ public class ContentControllerApi { | ||
| 189 | return new ResponseBean(ErrorEnum.ERROR); | 194 | return new ResponseBean(ErrorEnum.ERROR); |
| 190 | } | 195 | } |
| 191 | } | 196 | } |
| 197 | + | ||
| 198 | + @GetMapping("/detail/{id}.html") | ||
| 199 | + public Object getContentDetail(Model model, @PathVariable Integer id) { | ||
| 200 | + System.out.println("1111"); | ||
| 201 | + ShyContent content = contentService.selectByPrimaryKey(id); | ||
| 202 | + model.addAttribute("content", content.getContent_text()); | ||
| 203 | + return "html/contentPage.html"; | ||
| 204 | + } | ||
| 205 | + | ||
| 192 | 206 | ||
| 193 | } | 207 | } |
src/main/java/com/cnlive/shenhe/entity/ShyContent.java
| @@ -107,14 +107,17 @@ public class ShyContent { | @@ -107,14 +107,17 @@ public class ShyContent { | ||
| 107 | * 内容标题 | 107 | * 内容标题 |
| 108 | */ | 108 | */ |
| 109 | private String title; | 109 | private String title; |
| 110 | - | 110 | + |
| 111 | /** | 111 | /** |
| 112 | * sp名称 | 112 | * sp名称 |
| 113 | */ | 113 | */ |
| 114 | @Transient | 114 | @Transient |
| 115 | private String sp_desc; | 115 | private String sp_desc; |
| 116 | 116 | ||
| 117 | - | 117 | + /** |
| 118 | + * 图文文本内容 | ||
| 119 | + */ | ||
| 120 | + private String content_text; | ||
| 118 | 121 | ||
| 119 | /** | 122 | /** |
| 120 | * @return id | 123 | * @return id |
| @@ -496,4 +499,22 @@ public class ShyContent { | @@ -496,4 +499,22 @@ public class ShyContent { | ||
| 496 | public void setTitle(String title) { | 499 | public void setTitle(String title) { |
| 497 | this.title = title; | 500 | this.title = title; |
| 498 | } | 501 | } |
| 502 | + | ||
| 503 | + /** | ||
| 504 | + * 获取图文文本内容 | ||
| 505 | + * | ||
| 506 | + * @return content_text - 图文文本内容 | ||
| 507 | + */ | ||
| 508 | + public String getContent_text() { | ||
| 509 | + return content_text; | ||
| 510 | + } | ||
| 511 | + | ||
| 512 | + /** | ||
| 513 | + * 设置图文文本内容 | ||
| 514 | + * | ||
| 515 | + * @param content_text 图文文本内容 | ||
| 516 | + */ | ||
| 517 | + public void setContent_text(String content_text) { | ||
| 518 | + this.content_text = content_text; | ||
| 519 | + } | ||
| 499 | } | 520 | } |
| 500 | \ No newline at end of file | 521 | \ No newline at end of file |
src/main/resources/mapper/ShyContentMapper.xml
| @@ -26,5 +26,6 @@ | @@ -26,5 +26,6 @@ | ||
| 26 | <result column="updater" jdbcType="VARCHAR" property="updater" /> | 26 | <result column="updater" jdbcType="VARCHAR" property="updater" /> |
| 27 | <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" /> | 27 | <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" /> |
| 28 | <result column="title" jdbcType="LONGVARCHAR" property="title" /> | 28 | <result column="title" jdbcType="LONGVARCHAR" property="title" /> |
| 29 | + <result column="content_text" jdbcType="LONGVARCHAR" property="content_text" /> | ||
| 29 | </resultMap> | 30 | </resultMap> |
| 30 | </mapper> | 31 | </mapper> |
| 31 | \ No newline at end of file | 32 | \ No newline at end of file |
src/main/resources/templates/html/contentPage.html
0 → 100644
| 1 | +<!DOCTYPE HTML> | ||
| 2 | +<html xmlns:th="http://www.thymeleaf.org"> | ||
| 3 | +<head> | ||
| 4 | + <title>图文内容</title> | ||
| 5 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
| 6 | +</head> | ||
| 7 | +<body> | ||
| 8 | + <div th:utext=" ${content}">3333</div> | ||
| 9 | +</body> | ||
| 10 | +</html> | ||
| 0 | \ No newline at end of file | 11 | \ No newline at end of file |