正在显示
4 个修改的文件
包含
31 行增加
和
22 行删除
| @@ -12,17 +12,17 @@ | @@ -12,17 +12,17 @@ | ||
| 12 | |用户中心-修改密码|待调试|2019.11.20|v1/user/changePassword| | 12 | |用户中心-修改密码|待调试|2019.11.20|v1/user/changePassword| |
| 13 | |用户中心-忘记密码|待调试|2019.11.20|v1/user/resetPassword| | 13 | |用户中心-忘记密码|待调试|2019.11.20|v1/user/resetPassword| |
| 14 | |用户中心-用户信息|待调试|2019.12.13|v1/user/userInfo| | 14 | |用户中心-用户信息|待调试|2019.12.13|v1/user/userInfo| |
| 15 | -|用户中心-切换企业|待调试| |v1/user/switchCompany| | ||
| 16 | -|用户中心-用户公司列表|待调试| |v1/user/companys| | ||
| 17 | -|机会发布-机会类型|待调试| |v1/chance/chanceType| | ||
| 18 | -|机会发布-模板列表|待调试| |v1/chance/templates| | ||
| 19 | -|机会发布-提交机会|待调试| |v1/chance/submit| | ||
| 20 | -|机会发布-部门列表|待调试| |v1/department/departments| | ||
| 21 | -|消息-公告|未开始| | | | ||
| 22 | -|消息-消息中心|未开始|2019.11.22|v1/message/messageCenter| | ||
| 23 | -|消息-标记已读|未开始|2019.11.22|v1/message/msgCenterRead| | ||
| 24 | -|消息-标记全部已读|未开始|2019.11.22|v1/message/msgCenterAllRead| | ||
| 25 | -|首页-公告|未开始| | | | 15 | +|用户中心-切换企业|待调试|2019.12.16|v1/user/switchCompany| |
| 16 | +|用户中心-用户公司列表|待调试|2019.12.17|v1/user/companys| | ||
| 17 | +|机会发布-机会类型|待调试|2019.12.17|v1/chance/chanceType| | ||
| 18 | +|机会发布-模板列表|待调试|2019.12.18|v1/chance/templates| | ||
| 19 | +|机会发布-提交机会|待调试|2019.12.19|v1/chance/submit| | ||
| 20 | +|机会发布-部门列表|待调试|2019.12.19|v1/department/departments| | ||
| 21 | +|消息-公告|待调试|2019.12.20|v1/message/msgCompanyNotice| | ||
| 22 | +|消息-消息中心|待调试|2019.12.20|v1/message/messageCenter| | ||
| 23 | +|消息-标记已读|待调试|2019.12.20|v1/message/msgCenterRead| | ||
| 24 | +|消息-标记全部已读|待调试|2019.12.21|v1/message/msgCenterAllRead| | ||
| 25 | +|首页-公告|待调试|2019.12.21|/v1/message/announcements| | ||
| 26 | 26 | ||
| 27 | ### 阶段二接口完成进度 | 27 | ### 阶段二接口完成进度 |
| 28 | |功能|完成状态|时间|接口路径 | 28 | |功能|完成状态|时间|接口路径 |
| @@ -7,13 +7,13 @@ import ( | @@ -7,13 +7,13 @@ import ( | ||
| 7 | ) | 7 | ) |
| 8 | 8 | ||
| 9 | type ChanceType struct { | 9 | type ChanceType struct { |
| 10 | - Id int `orm:"column(id);auto"` | ||
| 11 | - Name string `orm:"column(name);size(50)" description:"机会类型名称"` | ||
| 12 | - Icon string `orm:"column(icon);size(500);null" description:"图标地址"` | ||
| 13 | - CompanyId int `orm:"column(company_id)" description:"表company.id 公司编号"` | ||
| 14 | - SortNum int `orm:"column(sort_num);null" description:"序号 公司下的序号"` | ||
| 15 | - CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间 "` | ||
| 16 | - UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间 "` | 10 | + Id int `orm:"column(id);auto" json:"id"` |
| 11 | + Name string `orm:"column(name);size(50)" description:"机会类型名称" json:"name"` | ||
| 12 | + Icon string `orm:"column(icon);size(500);null" description:"图标地址" json:"icon"` | ||
| 13 | + CompanyId int `orm:"column(company_id)" description:"表company.id 公司编号" json:"-"` | ||
| 14 | + SortNum int `orm:"column(sort_num);null" description:"序号 公司下的序号" json:"-"` | ||
| 15 | + CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间 " json:"-"` | ||
| 16 | + UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间 " json:"-"` | ||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | func (t *ChanceType) TableName() string { | 19 | func (t *ChanceType) TableName() string { |
| @@ -77,7 +77,7 @@ func DeleteChanceType(id int) (err error) { | @@ -77,7 +77,7 @@ func DeleteChanceType(id int) (err error) { | ||
| 77 | func GetChanceTypeAll(companyId int64) (v []*ChanceType, err error) { | 77 | func GetChanceTypeAll(companyId int64) (v []*ChanceType, err error) { |
| 78 | o := orm.NewOrm() | 78 | o := orm.NewOrm() |
| 79 | sql := "select * from chance_type where company_id=? order by sort_num" | 79 | sql := "select * from chance_type where company_id=? order by sort_num" |
| 80 | - if _, err = o.Raw(sql).QueryRows(&v, companyId); err == nil { | 80 | + if _, err = o.Raw(sql, companyId).QueryRows(&v); err == nil { |
| 81 | return | 81 | return |
| 82 | } | 82 | } |
| 83 | return | 83 | return |
| @@ -144,7 +144,7 @@ type Announcement struct { | @@ -144,7 +144,7 @@ type Announcement struct { | ||
| 144 | Title string `json:"title" valid:"Required"` | 144 | Title string `json:"title" valid:"Required"` |
| 145 | Cover Cover `json:"cover" valid:"Required"` | 145 | Cover Cover `json:"cover" valid:"Required"` |
| 146 | Link string `json:"link"` | 146 | Link string `json:"link"` |
| 147 | - Control int `json:"Control"` | 147 | + Control int `json:"control"` |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /*AnnouncementRead */ | 150 | /*AnnouncementRead */ |
| @@ -143,11 +143,20 @@ END: | @@ -143,11 +143,20 @@ END: | ||
| 143 | 143 | ||
| 144 | //机会类型 | 144 | //机会类型 |
| 145 | func ChanceType(header *protocol.RequestHeader, request *protocol.ChanceTypeRequest) (rsp *protocol.ChanceTypeResponse, err error) { | 145 | func ChanceType(header *protocol.RequestHeader, request *protocol.ChanceTypeRequest) (rsp *protocol.ChanceTypeResponse, err error) { |
| 146 | - var () | 146 | + var ( |
| 147 | + list []*models.ChanceType | ||
| 148 | + ) | ||
| 147 | rsp = &protocol.ChanceTypeResponse{} | 149 | rsp = &protocol.ChanceTypeResponse{} |
| 148 | - if rsp.List, err = models.GetChanceTypeAll(header.CompanyId); err != nil { | 150 | + rsp.List = make([]*models.ChanceType, 0) |
| 151 | + if list, err = models.GetChanceTypeAll(header.CompanyId); err != nil { | ||
| 152 | + if err == orm.ErrNoRows { | ||
| 153 | + err = nil | ||
| 154 | + return | ||
| 155 | + } | ||
| 156 | + log.Error(err) | ||
| 149 | return | 157 | return |
| 150 | } | 158 | } |
| 159 | + rsp.List = append(rsp.List, list...) | ||
| 151 | return | 160 | return |
| 152 | } | 161 | } |
| 153 | 162 |
-
请 注册 或 登录 后发表评论