Commit e51c719d28483d5ca82ee0c6ef17ac50366d714d

Authored by landong2015
1 parent 7a450a8c63
Exists in master

提交代码

Showing 7 changed files with 270 additions and 6 deletions

mainData/src/main/java/com/lymsh/yimiao/main/data/util/ArticleContext.java View file @ e51c719
  1 +package com.lymsh.yimiao.main.data.util;
  2 +
  3 +/**
  4 + * Created by Administrator on 2016/5/14 0014.
  5 + */
  6 +public class ArticleContext {
  7 +
  8 + private String errorcode;
  9 + private String errormsg;
  10 + private Integer id;
  11 + private String title;
  12 + private String content;
  13 + private ImageContext image;
  14 +
  15 + public String getErrorcode() {
  16 + return errorcode;
  17 + }
  18 +
  19 + public void setErrorcode(String errorcode) {
  20 + this.errorcode = errorcode;
  21 + }
  22 +
  23 + public String getErrormsg() {
  24 + return errormsg;
  25 + }
  26 +
  27 + public void setErrormsg(String errormsg) {
  28 + this.errormsg = errormsg;
  29 + }
  30 +
  31 + public Integer getId() {
  32 + return id;
  33 + }
  34 +
  35 + public void setId(Integer id) {
  36 + this.id = id;
  37 + }
  38 +
  39 + public String getTitle() {
  40 + return title;
  41 + }
  42 +
  43 + public void setTitle(String title) {
  44 + this.title = title;
  45 + }
  46 +
  47 + public String getContent() {
  48 + return content;
  49 + }
  50 +
  51 + public void setContent(String content) {
  52 + this.content = content;
  53 + }
  54 +
  55 + public ImageContext getImage() {
  56 + return image;
  57 + }
  58 +
  59 + public void setImage(ImageContext image) {
  60 + this.image = image;
  61 + }
  62 +}
mainData/src/main/java/com/lymsh/yimiao/main/data/util/ArticleUtil.java View file @ e51c719
... ... @@ -42,22 +42,46 @@
42 42 return null;
43 43 }
44 44  
45   - public static String getArticle(Integer categoryId,Integer page,Integer limit){
  45 + public static String getArticles(Integer categoryId,Integer page,Integer limit){
46 46 HttpClient client = new HttpClient();
47 47 GetMethod get = new MessageUtil.UTF8GetMethod("http://ams.api.stage.healthbaby.com.cn/v1/yiMiaoArticles.action?categoryId="+categoryId+"&page="+page+"&limit="+limit);
48 48 try {
49 49 client.executeMethod(get);
50 50 String result = new String(get.getResponseBodyAsString());
51 51 int statusCode = get.getStatusCode();
  52 + get.releaseConnection();
52 53 if (statusCode==200){
53 54 return result;
54 55 }
55   - get.releaseConnection();
  56 +
56 57 }catch (Exception e){
57 58 e.printStackTrace();
58 59 }
59 60 return null;
60 61 }
  62 +
  63 + public static ArticleContext getArticles(Integer id){
  64 +
  65 + ArticleContext articleContext = new ArticleContext();
  66 +
  67 + HttpClient client = new HttpClient();
  68 + GetMethod get = new MessageUtil.UTF8GetMethod("http://ams.api.stage.healthbaby.com.cn/v1/article.action?id="+id);
  69 + try {
  70 + client.executeMethod(get);
  71 + String result = new String(get.getResponseBodyAsString());
  72 + get.releaseConnection();
  73 + int statusCode = get.getStatusCode();
  74 + if (statusCode==200){
  75 + articleContext = JsonUtil.str2Obj(result,ArticleContext.class);
  76 + return articleContext;
  77 + }
  78 +
  79 + }catch (Exception e){
  80 + e.printStackTrace();
  81 + }
  82 + return articleContext;
  83 + }
  84 +
61 85  
62 86 }
mainData/src/main/java/com/lymsh/yimiao/main/data/util/ImageContext.java View file @ e51c719
  1 +package com.lymsh.yimiao.main.data.util;
  2 +
  3 +/**
  4 + * Created by Administrator on 2016/5/14 0014.
  5 + */
  6 +public class ImageContext {
  7 +
  8 + private String key;
  9 + private String medium;
  10 + private String real;
  11 +
  12 + public String getKey() {
  13 + return key;
  14 + }
  15 +
  16 + public void setKey(String key) {
  17 + this.key = key;
  18 + }
  19 +
  20 + public String getMedium() {
  21 + return medium;
  22 + }
  23 +
  24 + public void setMedium(String medium) {
  25 + this.medium = medium;
  26 + }
  27 +
  28 + public String getReal() {
  29 + return real;
  30 + }
  31 +
  32 + public void setReal(String real) {
  33 + this.real = real;
  34 + }
  35 +}
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/ArticleController.java View file @ e51c719
... ... @@ -3,6 +3,7 @@
3 3 import com.lymsh.mommybaby.basecommon.base.BaseController;
4 4 import com.lymsh.mommybaby.basecommon.base.TokenRequired;
5 5 import com.lymsh.mommybaby.basecommon.util.JsonUtil;
  6 +import com.lymsh.yimiao.main.data.util.ArticleContext;
6 7 import com.lymsh.yimiao.main.data.util.ArticleUtil;
7 8 import org.springframework.stereotype.Controller;
8 9 import org.springframework.web.bind.annotation.RequestMapping;
9 10  
10 11  
... ... @@ -33,14 +34,30 @@
33 34 writeJson(response, JsonUtil.obj2JsonString(ArticleUtil.getCategory()));
34 35 }
35 36  
36   - //获取文章
  37 + //获取文章列表
37 38 @RequestMapping(value = "/article", method = RequestMethod.GET)
38 39 @TokenRequired
39   - public void get(HttpServletResponse response,
  40 + public void getArticles(HttpServletResponse response,
40 41 @RequestParam("categoryId")Integer categoryId,
41 42 @RequestParam("page")Integer page,
42 43 @RequestParam("limit")Integer limit){
43   - writeJson(response, JsonUtil.obj2JsonString(ArticleUtil.getArticle(categoryId,page,limit)));
  44 + writeJson(response, JsonUtil.obj2JsonString(ArticleUtil.getArticles(categoryId, page, limit)));
  45 + }
  46 +
  47 + //获取文章
  48 + @RequestMapping(value = "/articles")
  49 + public void getArticles(HttpServletResponse response,
  50 + @RequestParam("id")Integer id){
  51 +
  52 + ArticleContext articleContext = ArticleUtil.getArticles(id);
  53 + if (articleContext!=null){
  54 +
  55 +
  56 +
  57 +
  58 + }
  59 +
  60 +
44 61 }
45 62  
46 63 }
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/KidsController.java View file @ e51c719
... ... @@ -471,7 +471,7 @@
471 471 mouthMap.put("freeList", freeList);
472 472 mouthMap.put("chargeList", chargeList);
473 473 mouthList.add(mouthMap);
474   - map.put(monthYear + "monthsOfAge", mouthList);
  474 + map.put("monthsOfAge"+monthYear, mouthList);
475 475 list.add(map);
476 476 }
477 477  
webApi/src/main/webapp/WEB-INF/html/arguments.vm View file @ e51c719
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3 +<html xmlns="http://www.w3.org/1999/xhtml" class="mommyboby">
  4 +<head>
  5 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6 + <title>服务协议</title>
  7 +
  8 + <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  9 + <meta content="IE=edge" http-equiv="X-UA-Compatible">
  10 + <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
  11 +
  12 + <style>
  13 + .container {
  14 + margin:15px 10px 10px 20px;
  15 + font-size: 14px;
  16 + line-height: 22px;
  17 + color: #979797;
  18 + font-weight: 100;
  19 + }
  20 + .container h5 {
  21 + font-size: 16px;
  22 + margin: 0px 0;
  23 + }
  24 + </style>
  25 +
  26 +
  27 +</head>
  28 +
  29 +
  30 +<body>
  31 +
  32 +<div class="container">
  33 + <h5>一、总则</h5>
  34 + <p>1.1 本《用户协议》是您与龙源美生医疗投资(北京)有限公司(简称:美生医疗)之间关于用户安装使用“亿苗儿APP”,以及使用本软件相关服务所订立的协议。</p>
  35 + <p>1.2 美生医疗提醒您在使用本服务前认真阅读、充分理解本服务条款、包括免除或限制美生医疗责任的免责条款以及对使用本服务的用户权利的限制条款。</p>
  36 + <p>
  37 + 1.3 一旦您选择同意本服务条款或使用本服务,则说明您已了解并完全同意本服务条款。美生医疗有权随时修改下述条款和条件,并只需公示于本服务,而无需征得您的事先同意。修改后的条款于公示时即时生效。在本服务公示修改后的服务条款后,您继续使用本服务的,视作您已接受修改后的条款。</p>
  38 + <h5>二、服务概要</h5>
  39 + <p>
  40 + 2.1 本服务提供您所选择当地的免疫规划一类疫苗和二类疫苗接种程序、接种日期倒计时提醒、预防接种单位信息,相关疾病的科普知识,以及下次接种时间提醒(限于已开通本服务的地区和接种单位)等。以上信息服务均为免费,美生医疗保留随时变更、中断或终止部分或全部服务的权利。</p>
  41 + <h5>三、服务风险及免责声明</h5>
  42 + <p>
  43 + 3.1 本服务所提供的信息,只供参考之用,不用于任何商业用途。本服务所提供的预防接种知识及预防接种单位信息,旨在方便用户自己管理家庭中适龄儿童的预防接种。如本服务所载信息与预防接种单位实际情况有出入,以最终提供合法预防接种服务单位的咨询结果为准。本服务中的疾病类的相关知识旨在科普宣传所用,如用户在日常生活中出现文中所提及症状,应尽早前往医院就医。本服务不对用户依照本服务提供的信息所作的决定以及所产生的结果承担任何直接或间接的法律责任。</p>
  44 + <p>3.2美生医疗不保证向用户提供便利而设置的外部链接的准确性和完整性,同时,对于该等外部链接指向的不由本服务实际控制的任何网页上的内容,美生医疗不承担任何责任。</p>
  45 + <p>3.3美生医疗保留自行决定更正本服务中任何部分的任何错误或遗漏的权利。</p>
  46 + <h5>四、用户隐私保护</h5>
  47 + <p>4.1美生医疗会采取合理的措施保护用户上传(或基于用户确认可采集和获取)的个人隐私信息,未经用户同意不向除合作方以外的第三方公开、透露用户个人隐私信息。</p>
  48 + <p>4.2为了改善美生医疗的技术和服务,我们将可能会收集、使用用户的非个人隐私信息,以提供更好的用户体验和服务质量。</p>
  49 + <p>
  50 + 4.3用户同意注册,即视为同意美生医疗获取用户及其儿童的相关同步信息(包括但不限于儿童的个人身份识别信息、详细接种信息、预留手机号码等),以用于提供更准确、优质的服务。美生医疗将采取合理的措施保护用户个人隐私信息,未经用户同意不向除合作方以外的第三方公开、透露用户个人隐私信息。</p>
  51 + <h5>五、知识产权声明</h5>
  52 + <p>
  53 + 美生医疗拥有本服务内所有内容的知识产权,所有这些内容受版权、商标和其它财产所有权法律的保护。任何人只有在获得美生医疗的书面授权之后才能使用这些内容,而不能擅自复制、修改、制作衍生产品、进行还原工程、反向编译,或以其它方式转移软件的任何权利,或用于任何商业目的。</p>
  54 + <h5>六、其他条款</h5>
  55 + <p>
  56 + 本《协议》签订地约定为深圳。本《协议》的解释、效力及纠纷的解决,适用于中华人民共和国法律。若用户和龙源美生医疗投资(北京)有限公司之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,用户在此完全同意将纠纷或争议提交龙源美生医疗投资(北京)有限公司住所地即深圳市有管辖权的人民法院管辖。</p>
  57 +
  58 +</div>
  59 +
  60 +
  61 +</body>
  62 +
  63 +
  64 +
  65 +
  66 +</html>
webApi/src/main/webapp/WEB-INF/html/article.vm View file @ e51c719
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3 +<html xmlns="http://www.w3.org/1999/xhtml" class="mommyboby">
  4 +<head>
  5 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6 + <title>服务协议</title>
  7 +
  8 + <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  9 + <meta content="IE=edge" http-equiv="X-UA-Compatible">
  10 + <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
  11 +
  12 + <style>
  13 + .container {
  14 + margin:15px 10px 10px 20px;
  15 + font-size: 14px;
  16 + line-height: 22px;
  17 + color: #979797;
  18 + font-weight: 100;
  19 + }
  20 + .container h1 {
  21 + font-weight: normal;
  22 + font-size: 15px;
  23 + line-height: 45px;
  24 + color: #59bbb8;
  25 + }
  26 + .container h5 {
  27 + font-size: 14px;
  28 + margin: 0px 0;
  29 + }
  30 + .container img {
  31 + width: 100%;
  32 + height: auto;
  33 + margin-bottom:12px;
  34 + }
  35 + </style>
  36 +
  37 +
  38 +</head>
  39 +
  40 +
  41 +<body>
  42 +
  43 +<div class="container">
  44 + <h1>疫苗知识汇总</h1>
  45 + <p><img src="http://7xnggy.com1.z0.glb.clouddn.com/168饮食避免食用鱼类.jpg" width="299" height="200" border="0" hspace="0" vspace="0" title="" style="width: 299px; height: 200px;"/></p><p>在药物治疗结核期间,请您避免食用无鳞鱼类及淡水鱼。因为抗组结核药物中的异烟肼是一种单胺氧化酶抑制剂,会影响体内组织胺的代谢。而鱼类组织胺的含量很高。在异烟肼治疗期间,如果食用鱼类,会因为缺少有效的单胺氧化酶抑制剂将鱼肉中的组织胺氧化,可能会造成体内组织胺大量蓄积。这就会引起头痛、头晕、恶心、荨麻疹样皮疹、呕吐、腹痛、腹泻、呼吸困难、血压升高等症状。更甚者,会出现高血压危象和脑出血等严重威胁生命安全的情况。</p><p>因此建议您在抗结核药物治疗期间,为了您和宝贝的安全最好不要食用无鳞鱼类和淡水鱼。常见的无鳞鱼类有金枪鱼、鱿鱼、沙丁鱼等。如果您实在想吃鱼的话可以选用有鳞的海鱼,但请您注意,选择的海鱼是一定得是新鲜的(最好是活鱼)。因为不新鲜的海鱼中同样含有大量的组织胺。即使是能吃的鱼类,也不要吃太多,每周一次就可以了。</p><p>&nbsp;</p><p><br/></p>
  46 +</div>
  47 +
  48 +</body>
  49 +
  50 +<script>
  51 + window.onload = function () {
  52 + var tags = document.body.getElementsByTagName('*');
  53 + for (var i = 0; i < tags.length; i++) {
  54 + tags[i].removeAttribute('style');
  55 + }
  56 + }
  57 +</script>
  58 +
  59 +
  60 +</html>