|
@@ -0,0 +1,210 @@
|
|
|
+
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+ <head>
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
+ <title>service: Go Coverage Report</title>
|
|
|
+ <style>
|
|
|
+ body {
|
|
|
+ background: black;
|
|
|
+ color: rgb(80, 80, 80);
|
|
|
+ }
|
|
|
+ body, pre, #legend span {
|
|
|
+ font-family: Menlo, monospace;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ #topbar {
|
|
|
+ background: black;
|
|
|
+ position: fixed;
|
|
|
+ top: 0; left: 0; right: 0;
|
|
|
+ height: 42px;
|
|
|
+ border-bottom: 1px solid rgb(80, 80, 80);
|
|
|
+ }
|
|
|
+ #content {
|
|
|
+ margin-top: 50px;
|
|
|
+ }
|
|
|
+ #nav, #legend {
|
|
|
+ float: left;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ #legend {
|
|
|
+ margin-top: 12px;
|
|
|
+ }
|
|
|
+ #nav {
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ #legend span {
|
|
|
+ margin: 0 5px;
|
|
|
+ }
|
|
|
+ .cov0 { color: rgb(192, 0, 0) }
|
|
|
+.cov1 { color: rgb(128, 128, 128) }
|
|
|
+.cov2 { color: rgb(116, 140, 131) }
|
|
|
+.cov3 { color: rgb(104, 152, 134) }
|
|
|
+.cov4 { color: rgb(92, 164, 137) }
|
|
|
+.cov5 { color: rgb(80, 176, 140) }
|
|
|
+.cov6 { color: rgb(68, 188, 143) }
|
|
|
+.cov7 { color: rgb(56, 200, 146) }
|
|
|
+.cov8 { color: rgb(44, 212, 149) }
|
|
|
+.cov9 { color: rgb(32, 224, 152) }
|
|
|
+.cov10 { color: rgb(20, 236, 155) }
|
|
|
+
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div id="topbar">
|
|
|
+ <div id="nav">
|
|
|
+ <select id="files">
|
|
|
+
|
|
|
+ <option value="file0">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go (81.0%)</option>
|
|
|
+
|
|
|
+ <option value="file1">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go (100.0%)</option>
|
|
|
+
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div id="legend">
|
|
|
+ <span>not tracked</span>
|
|
|
+
|
|
|
+ <span class="cov0">no coverage</span>
|
|
|
+ <span class="cov1">low coverage</span>
|
|
|
+ <span class="cov2">*</span>
|
|
|
+ <span class="cov3">*</span>
|
|
|
+ <span class="cov4">*</span>
|
|
|
+ <span class="cov5">*</span>
|
|
|
+ <span class="cov6">*</span>
|
|
|
+ <span class="cov7">*</span>
|
|
|
+ <span class="cov8">*</span>
|
|
|
+ <span class="cov9">*</span>
|
|
|
+ <span class="cov10">high coverage</span>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="content">
|
|
|
+
|
|
|
+ <pre class="file" id="file0" style="display: none">package service
|
|
|
+
|
|
|
+import (
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/log"
|
|
|
+ "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
|
|
|
+ "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
|
|
|
+ "fmt"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+type AuthService struct{}
|
|
|
+
|
|
|
+//认证信息保存
|
|
|
+func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) <span class="cov10" title="4">{
|
|
|
+ //先判断用户是否存在
|
|
|
+ user := entity.BaseMysql.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
|
|
|
+ "user_id": in.UserId,"appid":in.Appid,
|
|
|
+ }, "id", "")
|
|
|
+ if user != nil </span><span class="cov5" title="2">{
|
|
|
+ if in.OperationType == "add" </span><span class="cov1" title="1">{
|
|
|
+ return false, "用户已验证"
|
|
|
+ }</span>
|
|
|
+ } else<span class="cov5" title="2"> {
|
|
|
+ if in.OperationType == "update" </span><span class="cov1" title="1">{
|
|
|
+ return false, "用户未认证,不可修改"
|
|
|
+ }</span>
|
|
|
+ }
|
|
|
+
|
|
|
+ <span class="cov5" title="2">if in.OperationType == "update" </span><span class="cov1" title="1">{
|
|
|
+ //修改处理
|
|
|
+ data := map[string]interface{}{
|
|
|
+ "name": in.Name,
|
|
|
+ "phone": in.Phone,
|
|
|
+ "position": in.Position,
|
|
|
+ "department": in.Department,
|
|
|
+ "mail": in.Mail,
|
|
|
+ "ent_code": in.EntCode,
|
|
|
+ "ent_name": in.EntName,
|
|
|
+ }
|
|
|
+ ok1 := entity.BaseMysql.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId,"appid":in.Appid}, data)
|
|
|
+ if ok1 </span><span class="cov1" title="1">{
|
|
|
+ return true, ""
|
|
|
+ }</span> else<span class="cov0" title="0"> {
|
|
|
+ log.Println(fmt.Sprintf("认证修改失败:入参:%v:%v,", in.UserId, data))
|
|
|
+ return false, "修改失败"
|
|
|
+ }</span>
|
|
|
+ } else<span class="cov1" title="1"> {
|
|
|
+ //新增处理
|
|
|
+ data := map[string]interface{}{
|
|
|
+ "name": in.Name,
|
|
|
+ "phone": in.Phone,
|
|
|
+ "position": in.Position,
|
|
|
+ "department": in.Department,
|
|
|
+ "mail": in.Mail,
|
|
|
+ "ent_code": in.EntCode,
|
|
|
+ "ent_name": in.EntName,
|
|
|
+ "user_id": in.UserId,
|
|
|
+ "create_time": time.Now().Local(),
|
|
|
+ "appid":in.Appid,
|
|
|
+ }
|
|
|
+ ok := entity.BaseMysql.Insert(entity.DOMAIN_CAPITAL_RETENTION, data)
|
|
|
+ if ok > 0 </span><span class="cov1" title="1">{
|
|
|
+ return true, ""
|
|
|
+ }</span> else<span class="cov0" title="0"> {
|
|
|
+ log.Println(fmt.Sprintf("认证失败:参数:%v", data))
|
|
|
+ return false, "认证失败"
|
|
|
+ }</span>
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//认证信息查询
|
|
|
+func (b AuthService) UserAuthInfo(in *medical.CommonReq) *map[string]interface{} <span class="cov5" title="2">{
|
|
|
+ //先判断用户是否存在
|
|
|
+ user := entity.BaseMysql.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
|
|
|
+ "user_id": in.UserId,"appid":in.Appid,
|
|
|
+ }, "id", "")
|
|
|
+ return user
|
|
|
+}</span>
|
|
|
+</pre>
|
|
|
+
|
|
|
+ <pre class="file" id="file1" style="display: none">package service
|
|
|
+
|
|
|
+import (
|
|
|
+ "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
|
|
|
+)
|
|
|
+
|
|
|
+type InstitutionService struct{}
|
|
|
+
|
|
|
+//医疗机构搜索条件
|
|
|
+func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]interface{}) <span class="cov8" title="1">{
|
|
|
+ //机构类型
|
|
|
+ levelList = entity.Mysql.Find(entity.CODE_MEDICAL_INSTITUTION_LEVEL, nil, "*", "", -1, -1)
|
|
|
+ //医院等级
|
|
|
+ typeList = entity.Mysql.Find(entity.CODE_MEDICAL_INSTITUTION_TYPE, nil, "*", "", -1, -1)
|
|
|
+ return
|
|
|
+}</span>
|
|
|
+</pre>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </body>
|
|
|
+ <script>
|
|
|
+ (function() {
|
|
|
+ var files = document.getElementById('files');
|
|
|
+ var visible;
|
|
|
+ files.addEventListener('change', onChange, false);
|
|
|
+ function select(part) {
|
|
|
+ if (visible)
|
|
|
+ visible.style.display = 'none';
|
|
|
+ visible = document.getElementById(part);
|
|
|
+ if (!visible)
|
|
|
+ return;
|
|
|
+ files.value = part;
|
|
|
+ visible.style.display = 'block';
|
|
|
+ location.hash = part;
|
|
|
+ }
|
|
|
+ function onChange() {
|
|
|
+ select(files.value);
|
|
|
+ window.scrollTo(0, 0);
|
|
|
+ }
|
|
|
+ if (location.hash != "") {
|
|
|
+ select(location.hash.substr(1));
|
|
|
+ }
|
|
|
+ if (!visible) {
|
|
|
+ select("file0");
|
|
|
+ }
|
|
|
+ })();
|
|
|
+ </script>
|
|
|
+</html>
|