From dabb567d41b70882538d91bd0dc5643773c64c85 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 26 Nov 2021 17:26:01 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0=E4=B8=93?= =?UTF-8?q?=E5=88=A9=E6=A8=A1=E5=9E=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/enterprise/api/sys.go | 27 +++++ app/api/enterprise/api/user.go | 11 ++ app/api/enterprise/controller/sys/patent.go | 97 ++++++++++++++++ .../controller/technology/instance.go | 6 +- .../controller/technology/product.go | 4 +- .../enterprise/controller/tenant/instance.go | 14 +++ app/api/enterprise/controller/user/patent.go | 105 +++++++++++++++++ app/api/enterprise/model/sys_patent.go | 12 ++ app/api/enterprise/model/user_patent.go | 11 ++ app/common/init.go | 3 + app/common/model/common.go | 2 +- app/common/model/model.go | 19 +++ app/common/model/sys_patent.go | 55 +++++++++ app/common/model/technology_prodcut.go | 108 ++++++++++++++++++ app/common/model/user_consume.go | 18 +++ app/common/model/user_patent.go | 19 +++ router/address.go | 8 +- 17 files changed, 512 insertions(+), 7 deletions(-) create mode 100644 app/api/enterprise/api/sys.go create mode 100644 app/api/enterprise/controller/sys/patent.go create mode 100644 app/api/enterprise/controller/user/patent.go create mode 100644 app/api/enterprise/model/sys_patent.go create mode 100644 app/api/enterprise/model/user_patent.go create mode 100644 app/common/model/sys_patent.go create mode 100644 app/common/model/technology_prodcut.go create mode 100644 app/common/model/user_consume.go create mode 100644 app/common/model/user_patent.go diff --git a/app/api/enterprise/api/sys.go b/app/api/enterprise/api/sys.go new file mode 100644 index 0000000..f8e89c5 --- /dev/null +++ b/app/api/enterprise/api/sys.go @@ -0,0 +1,27 @@ +package api + +import ( + "SciencesServer/app/api/enterprise/controller/sys" + "SciencesServer/app/basic/api" + "github.com/gin-gonic/gin" +) + +type Sys struct{} + +func (*Sys) Patent(c *gin.Context) { + form := &struct { + Kind int `json:"kind" form:"kind"` + Title string `json:"title" form:"title"` + ApplyCode string `json:"apply_code" form:"apply_code"` + OpenCode string `json:"open_code" form:"open_code"` + IPCCode string `json:"ipc_code" form:"ipc_code"` + api.PageForm + }{} + if err := api.Bind(form)(c); err != nil { + api.APIFailure(err.(error))(c) + return + } + data, err := sys.NewPatent()(nil). + List(form.Kind, form.Title, form.ApplyCode, form.OpenCode, form.IPCCode, form.Page, form.PageSize) + api.APIResponse(err, data)(c) +} diff --git a/app/api/enterprise/api/user.go b/app/api/enterprise/api/user.go index 1c41e71..e2d8689 100644 --- a/app/api/enterprise/api/user.go +++ b/app/api/enterprise/api/user.go @@ -158,3 +158,14 @@ func (*User) BackUnbind(c *gin.Context) { err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).Unbind(form.Convert()) api.APIResponse(err) } + +func (*User) Patent(c *gin.Context) { + form := &struct { + Title string `json:"title" form:"title"` + api.PageForm + }{} + if err := api.Bind(form)(c); err != nil { + api.APIFailure(err.(error))(c) + return + } +} diff --git a/app/api/enterprise/controller/sys/patent.go b/app/api/enterprise/controller/sys/patent.go new file mode 100644 index 0000000..4704bb1 --- /dev/null +++ b/app/api/enterprise/controller/sys/patent.go @@ -0,0 +1,97 @@ +package sys + +import ( + "SciencesServer/app/api/enterprise/model" + "SciencesServer/app/basic/controller" + model2 "SciencesServer/app/common/model" + "SciencesServer/app/session" + "SciencesServer/utils" + "strings" +) + +// Patent 专利信息 +type Patent struct { + *session.Enterprise +} + +type PatentHandle func(session *session.Enterprise) *Patent + +type ( + // PatentInfo 专利信息 + PatentInfo struct { + ID string `json:"id"` + Kind model2.SysParentKind `json:"kind"` + Title string `json:"title"` + } +) + +func (c *Patent) filter(src string) string { + src = utils.ReplaceAllCompile(src, "\t", "") + src = utils.ReplaceAllCompile(src, "\n", "") + src = strings.TrimLeft(src, " ") + src = strings.TrimRight(src, " ") + return src +} + +func (c *Patent) List(kind int, title, applyCode, openCode, ipcCode string, page, pageSize int) (*controller.ReturnPages, error) { + mSysPatent := model.NewSysPatent() + + where := []*model2.ModelWhereOrder{&model2.ModelWhereOrder{Order: model2.NewOrder("id", model2.OrderModeToDesc)}} + + if kind <= 0 { + where = append(where, &model2.ModelWhereOrder{ + Where: model2.NewWhere("kind", kind), + }) + } + if title != "" { + where = append(where, &model2.ModelWhereOrder{ + Where: model2.NewWhereLike("title", title), + }) + } + if applyCode != "" { + where = append(where, &model2.ModelWhereOrder{ + Where: model2.NewWhereLike("apply_code", applyCode), + }) + } + if openCode != "" { + where = append(where, &model2.ModelWhereOrder{ + Where: model2.NewWhereLike("open_code", openCode), + }) + } + if ipcCode != "" { + where = append(where, &model2.ModelWhereOrder{ + Where: model2.NewWhereLike("ipc_code", ipcCode), + }) + } + out := make([]*model2.SysPatent, 0) + + var count int64 + + if err := model2.Pages(mSysPatent.SysPatent, &out, page, pageSize, &count); err != nil { + return nil, err + } + + list := make([]*PatentInfo, 0) + + for _, v := range out { + list = append(list, &PatentInfo{ + ID: v.GetEncodeID(), + Kind: v.Kind, + Title: v.Title, + }) + v.ApplyName = c.filter(v.ApplyName) + v.ApplyAddress = c.filter(v.ApplyAddress) + v.Inventor = c.filter(v.Inventor) + v.Description = c.filter(v.Description) + } + return &controller.ReturnPages{ + Data: out, + Count: count, + }, nil +} + +func NewPatent() PatentHandle { + return func(session *session.Enterprise) *Patent { + return &Patent{Enterprise: session} + } +} diff --git a/app/api/enterprise/controller/technology/instance.go b/app/api/enterprise/controller/technology/instance.go index 826a952..2efea1b 100644 --- a/app/api/enterprise/controller/technology/instance.go +++ b/app/api/enterprise/controller/technology/instance.go @@ -120,7 +120,7 @@ func (c *Instance) Form(params *InstanceParams) error { func (c *Instance) Shelf(id uint64, status int) error { mTechnologyInstance := model.NewTechnologyInstance() mTechnologyInstance.ID = id - isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "m_uid", "shelf_status", "status"}) + isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "m_uid", "shelf", "status"}) if err != nil { return err @@ -130,11 +130,11 @@ func (c *Instance) Shelf(id uint64, status int) error { return errors.New("操作错误,无权限操作") } else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree { return errors.New("操作错误,当前状态不允许处理上下架") - } else if mTechnologyInstance.ShelfStatus.ShelfStatus == model2.ShelfStatusKind(status) { + } else if mTechnologyInstance.ShelfStatus.Shelf == model2.ShelfStatusKind(status) { return errors.New("操作错误,状态异常") } if err = model2.Updates(mTechnologyInstance.TechnologyInstance, map[string]interface{}{ - "shelf_status": status, "updated_at": time.Now(), + "shelf": status, "updated_at": time.Now(), }); err != nil { return err } diff --git a/app/api/enterprise/controller/technology/product.go b/app/api/enterprise/controller/technology/product.go index 9ff2154..5f21e52 100644 --- a/app/api/enterprise/controller/technology/product.go +++ b/app/api/enterprise/controller/technology/product.go @@ -158,11 +158,11 @@ func (c *Product) Shelf(id uint64, status int) error { return errors.New("操作错误,产品信息不存在或已被删除") } else if mTechnologyProduct.MUid != c.ManageUID { return errors.New("无权限操作") - } else if mTechnologyProduct.ShelfStatus.ShelfStatus == model2.ShelfStatusKind(status) { + } else if mTechnologyProduct.ShelfStatus.Shelf == model2.ShelfStatusKind(status) { return errors.New("操作错误,无需变更上下架状态") } return model2.Updates(mTechnologyProduct.TechnologyProduct, map[string]interface{}{ - "shelf_status": status, "updated_at": time.Now(), + "shelf": status, "updated_at": time.Now(), }) } diff --git a/app/api/enterprise/controller/tenant/instance.go b/app/api/enterprise/controller/tenant/instance.go index d1c1acb..8193d59 100644 --- a/app/api/enterprise/controller/tenant/instance.go +++ b/app/api/enterprise/controller/tenant/instance.go @@ -1 +1,15 @@ package tenant + +import "SciencesServer/app/session" + +type Instance struct { + *session.Enterprise +} + +type InstanceHandle func(session *session.Enterprise) *Instance + +func NewInstance() InstanceHandle { + return func(session *session.Enterprise) *Instance { + return &Instance{Enterprise: session} + } +} diff --git a/app/api/enterprise/controller/user/patent.go b/app/api/enterprise/controller/user/patent.go new file mode 100644 index 0000000..689bb32 --- /dev/null +++ b/app/api/enterprise/controller/user/patent.go @@ -0,0 +1,105 @@ +package user + +import ( + "SciencesServer/app/api/enterprise/model" + "SciencesServer/app/basic/controller" + model2 "SciencesServer/app/common/model" + "SciencesServer/app/session" + "SciencesServer/serve/orm" + "errors" + "gorm.io/gorm" + "time" +) + +type Patent struct { + *session.Enterprise + local string +} + +type PatentHandle func(session *session.Enterprise, local string) *Patent + +type ( + // PatentParams 专利参数信息 + PatentParams struct { + ID uint64 + Title string + } +) + +func (c *PatentParams) add() error { + return nil +} + +func (c *PatentParams) edit() error { + return nil +} + +func (c *Patent) List(kind int, title, applyCode, openCode, ipcCode string, page, pageSize int) (*controller.ReturnPages, error) { + return &controller.ReturnPages{ + Data: nil, + Count: 0, + }, nil +} + +func (c *Patent) Form(params *PatentParams) error { + if params.ID <= 0 { + return params.add() + } + return params.edit() +} + +// Shelf 上下架操作 +func (c *Patent) Shelf(id uint64, status int) error { + mUserPatent := model.NewUserPatent() + mUserPatent.ID = id + + isExist, err := model2.FirstField(mUserPatent.UserPatent, []string{"id", "uid", "patent_id"}) + + if err != nil { + return err + } else if !isExist { + return errors.New("操作错误,用户专利信息不存在或已被删除") + } else if mUserPatent.UID != c.UID { + return errors.New("无权限操作") + } + mSysPatent := model.NewSysPatent() + mSysPatent.ID = mUserPatent.PatentID + + return model2.Updates(mSysPatent.SysPatent, map[string]interface{}{ + "shelf": status, "updated_at": time.Now(), + }) +} + +// Delete 删除操作 +func (c *Patent) Delete(id uint64) error { + mUserPatent := model.NewUserPatent() + mUserPatent.ID = id + + isExist, err := model2.FirstField(mUserPatent.UserPatent, []string{"id", "uid", "patent_id"}) + + if err != nil { + return err + } else if !isExist { + return errors.New("操作错误,用户专利信息不存在或已被删除") + } else if mUserPatent.UID != c.UID { + return errors.New("无权限操作") + } + return orm.GetDB().Transaction(func(tx *gorm.DB) error { + if err = model2.Delete(mUserPatent.UserPatent); err != nil { + return err + } + mSysPatent := model.NewSysPatent() + mSysPatent.ID = mUserPatent.PatentID + + return model2.Delete(mSysPatent.SysPatent) + }) +} + +func NewPatent() PatentHandle { + return func(session *session.Enterprise, local string) *Patent { + return &Patent{ + Enterprise: session, + local: local, + } + } +} diff --git a/app/api/enterprise/model/sys_patent.go b/app/api/enterprise/model/sys_patent.go new file mode 100644 index 0000000..d4f092a --- /dev/null +++ b/app/api/enterprise/model/sys_patent.go @@ -0,0 +1,12 @@ +package model + +import "SciencesServer/app/common/model" + +// SysPatent 专利信息 +type SysPatent struct { + *model.SysPatent +} + +func NewSysPatent() *SysPatent { + return &SysPatent{model.NewSysPatent()} +} diff --git a/app/api/enterprise/model/user_patent.go b/app/api/enterprise/model/user_patent.go new file mode 100644 index 0000000..6314f85 --- /dev/null +++ b/app/api/enterprise/model/user_patent.go @@ -0,0 +1,11 @@ +package model + +import "SciencesServer/app/common/model" + +type UserPatent struct { + *model.UserPatent +} + +func NewUserPatent() *UserPatent { + return &UserPatent{model.NewUserPatent()} +} diff --git a/app/common/init.go b/app/common/init.go index 206f069..4f0fd16 100644 --- a/app/common/init.go +++ b/app/common/init.go @@ -49,6 +49,9 @@ func initModel() { &synchronized{iModel: model.NewSysConfig(), iValues: func() interface{} { return nil }}, + &synchronized{iModel: model.NewSysPatent(), iValues: func() interface{} { + return nil + }}, // 日志管理 &synchronized{iModel: model.NewSysUserRole()}, &synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()}, diff --git a/app/common/model/common.go b/app/common/model/common.go index 7dad52e..0ecd131 100644 --- a/app/common/model/common.go +++ b/app/common/model/common.go @@ -74,7 +74,7 @@ const ( // ShelfStatus 上下架状态 type ShelfStatus struct { - ShelfStatus ShelfStatusKind `gorm:"column:shelf_status;type:tinyint(1);default:0;comment:上下架状态(1:上架,2:下架)" json:"shelf_status"` + Shelf ShelfStatusKind `gorm:"column:shelf;type:tinyint(1);default:0;comment:上下架状态(1:上架,2:下架)" json:"shelf"` } type ShelfStatusKind int diff --git a/app/common/model/model.go b/app/common/model/model.go index 9226d79..bea0aea 100644 --- a/app/common/model/model.go +++ b/app/common/model/model.go @@ -373,6 +373,25 @@ func ScanFields(model IModel, out interface{}, fields []string, where ...*ModelW return db.Scan(out).Error } +func ScanLimitFields(model IModel, out interface{}, fields []string, limit int, where ...*ModelWhereOrder) error { + db := orm.GetDB().Table(model.TableName()).Select(fields) + + if len(where) > 0 { + for _, wo := range where { + if wo.Where != nil { + db = db.Where(wo.Where.Condition, wo.Where.Value) + } + if wo.Order != nil { + db = db.Order(fmt.Sprintf("%s %s", wo.Order.Field, wo.Order.Mode)) + } + } + } + if db.Migrator().HasColumn(model, FieldsForDeleted) { + db = db.Where(FieldsForDeleted, DeleteStatusForNot) + } + return db.Offset(0).Limit(limit).Scan(out).Error +} + func Pluck(model IModel, field string, out interface{}, where ...*ModelWhere) error { db := orm.GetDB().Table(model.TableName()) diff --git a/app/common/model/sys_patent.go b/app/common/model/sys_patent.go new file mode 100644 index 0000000..ad25676 --- /dev/null +++ b/app/common/model/sys_patent.go @@ -0,0 +1,55 @@ +package model + +// SysPatent 专利信息数据模型 +type SysPatent struct { + Model + Kind SysParentKind `gorm:"column:kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"` + Title string `gorm:"column:title;type:varchar(255);default:null;comment:名称标题" json:"title"` + FileUrl string `gorm:"column:file_url;type:varchar(255);default:null;comment:文件地址" json:"file_url"` + ApplyCode string `gorm:"column:apply_code;type:varchar(50);default:null;comment:申请号" json:"apply_code"` + ApplyAt string `gorm:"column:apply_at;type:varchar(30);default:null;comment:申请日" json:"apply_at"` + OpenCode string `gorm:"column:open_code;type:varchar(50);default:null;comment:公开(公告)号" json:"open_code"` + OpenAt string `gorm:"column:open_at;type:varchar(30);default:null;comment:公开(公告)日" json:"open_at"` + ApplyName string `gorm:"column:apply_name;type:varchar(100);default:null;comment:申请(专利权)人" json:"apply_name"` + ApplyAddress string `gorm:"column:apply_address;type:varchar(255);default:null;comment:申请人地址" json:"apply_address"` + Inventor string `gorm:"column:inventor;type:varchar(100);default:null;comment:发明人" json:"inventor"` + Description string `gorm:"column:description;type:text;default:null;comment:摘要" json:"description"` + PrincipalClaim string `gorm:"column:principal_claim;type:text;default:null;comment:主权项" json:"principal_claim"` + IPCCode string `gorm:"column:ipc_code;type:varchar(50);default:null;comment:IPC主分类号" json:"ipc_code"` + ShelfStatus + Status SysParentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1:授权,2:实审,3:公开)" json:"-"` + ModelDeleted + ModelAt +} + +// SysParentKind 专利类型 +type SysParentKind int + +const ( + // SysParentKindForInvent 发明专利 + SysParentKindForInvent SysParentKind = iota + 1 + // SysParentKindForDesign 外观设计 + SysParentKindForDesign + // SysParentKindForNewPractical 实用新型 + SysParentKindForNewPractical +) + +// SysParentStatus 专利状态 +type SysParentStatus int + +const ( + // SysParentStatusForAuthorize 授权 + SysParentStatusForAuthorize SysParentStatus = iota + 1 + // SysParentStatusForActualTrial 实审 + SysParentStatusForActualTrial + // SysParentStatusForPublic 公开 + SysParentStatusForPublic +) + +func (m *SysPatent) TableName() string { + return "sys_patent" +} + +func NewSysPatent() *SysPatent { + return &SysPatent{} +} diff --git a/app/common/model/technology_prodcut.go b/app/common/model/technology_prodcut.go new file mode 100644 index 0000000..98bfc17 --- /dev/null +++ b/app/common/model/technology_prodcut.go @@ -0,0 +1,108 @@ +package model + +import ( + "SciencesServer/app/basic/config" + "encoding/json" +) + +// TechnologyProduct 技术产品数据模型 +type TechnologyProduct struct { + Model + ModelTenant + Local + MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"` + Title string `gorm:"column:title;type:varchar(100);default:null;comment:产品名称" json:"title"` + Image + Video string `gorm:"column:video;type:varchar(255);default:null;comment:视频地址" json:"video"` + Material string `gorm:"column:material;type:varchar(255);default:null;comment:证明材料" json:"material"` + Industry string `gorm:"column:industry;type:varchar(255);default:null;comment:所属领域" json:"industry"` + Customer string `gorm:"column:customer;type:varchar(255);default:null;comment:应用客户" json:"-"` + Maturity config.TechnologyMaturity `gorm:"column:maturity;type:tinyint(1);default:0;comment:技术成熟度" json:"maturity"` + LeadStandard TechnologyProductLeadStandard `gorm:"column:lead_standard;type:tinyint(1);default:0;comment:领先标准" json:"lead_standard"` + CooperationMode config.TechnologyCooperationMode `gorm:"column:cooperation_mode;type:tinyint(1);default:0;comment:合作模式" json:"cooperation_mode"` + Keyword string `gorm:"column:keyword;type:varchar(255);default:null;comment:关键词" json:"-"` + Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"` + ShelfStatus + Status TechnologyProductStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"` + ModelDeleted + ModelAt +} + +// TechnologyProductLeadStandard 领先标准 +type TechnologyProductLeadStandard int + +const ( + // TechnologyProductLeadStandardForDomesticXJ 国内先进 + TechnologyProductLeadStandardForDomesticXJ TechnologyProductLeadStandard = iota + 1 + // TechnologyProductLeadStandardForDomesticLX 国内领先 + TechnologyProductLeadStandardForDomesticLX + // TechnologyProductLeadStandardForInternationalXJ 国际先进 + TechnologyProductLeadStandardForInternationalXJ + // TechnologyProductLeadStandardForInternationalLX 国际领先 + TechnologyProductLeadStandardForInternationalLX +) + +// TechnologyProductStatus 状态 +type TechnologyProductStatus int + +const ( + // TechnologyProductStatusForDraft 草稿箱 + TechnologyProductStatusForDraft TechnologyProductStatus = iota + // TechnologyProductStatusForExamining 审核中 + TechnologyProductStatusForExamining + // TechnologyProductStatusForAgree 审核通过 + TechnologyProductStatusForAgree + // TechnologyProductStatusForRefuse 审核拒绝 + TechnologyProductStatusForRefuse +) + +// TechnologyProductShelfStatus 上下架状态 +type TechnologyProductShelfStatus int + +const ( + // TechnologyProductShelfStatusForUp 上架 + TechnologyProductShelfStatusForUp TechnologyProductShelfStatus = iota + 1 + // TechnologyProductShelfStatusForDown 下架 + TechnologyProductShelfStatusForDown +) + +func (m *TechnologyProduct) TableName() string { + return "technology_product" +} + +func (m *TechnologyProduct) GetIndustryAttribute() []string { + out := make([]string, 0) + _ = json.Unmarshal([]byte(m.Industry), &out) + return out +} + +func (m *TechnologyProduct) SetIndustryAttribute(value []string) { + _bytes, _ := json.Marshal(value) + m.Industry = string(_bytes) +} + +func (m *TechnologyProduct) GetCustomerAttribute() []string { + out := make([]string, 0) + _ = json.Unmarshal([]byte(m.Customer), &out) + return out +} + +func (m *TechnologyProduct) SetCustomerAttribute(value []string) { + _bytes, _ := json.Marshal(value) + m.Customer = string(_bytes) +} + +func (m *TechnologyProduct) GetKeywordAttribute() []string { + out := make([]string, 0) + _ = json.Unmarshal([]byte(m.Keyword), &out) + return out +} + +func (m *TechnologyProduct) SetKeywordAttribute(value []string) { + _bytes, _ := json.Marshal(value) + m.Keyword = string(_bytes) +} + +func NewTechnologyProduct() *TechnologyProduct { + return &TechnologyProduct{} +} diff --git a/app/common/model/user_consume.go b/app/common/model/user_consume.go new file mode 100644 index 0000000..23bc322 --- /dev/null +++ b/app/common/model/user_consume.go @@ -0,0 +1,18 @@ +package model + +// UserConsume 用户资产消耗 +type UserConsume struct { + Model + UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"` + Source int `json:"source"` + ModelDeleted + ModelAt +} + +func (m *UserConsume) TableName() string { + return "user_consume" +} + +func NewUserConsume() *UserConsume { + return &UserConsume{} +} diff --git a/app/common/model/user_patent.go b/app/common/model/user_patent.go new file mode 100644 index 0000000..7effb47 --- /dev/null +++ b/app/common/model/user_patent.go @@ -0,0 +1,19 @@ +package model + +// UserPatent 用户专利信息数据模型 +type UserPatent struct { + Model + Local + UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"` + PatentID uint64 `gorm:"column:patent_id;type:int(11);default:0;comment:专利ID" json:"-"` + ModelDeleted + ModelAt +} + +func (m *UserPatent) TableName() string { + return "user_patent" +} + +func NewUserPatent() *UserPatent { + return &UserPatent{} +} diff --git a/router/address.go b/router/address.go index 58c8218..d516237 100644 --- a/router/address.go +++ b/router/address.go @@ -127,7 +127,7 @@ func registerEnterpriseAPI(app *gin.Engine) { apiPrefix := "/enterprise" g := app.Group(apiPrefix) - g.Use(NeedLogin(session.NewManage(), AddSkipperURL([]string{}...))) + //g.Use(NeedLogin(session.NewManage(), AddSkipperURL([]string{}...))) v1 := g.Group("/v1") @@ -148,6 +148,12 @@ func registerEnterpriseAPI(app *gin.Engine) { accountV1.POST("/authorize", _api.Authorize) accountV1.POST("/logout", _api.Logout) } + // Sys 配置管理 + sysV1 := v1.Group("/sys") + { + _api := new(api2.Sys) + sysV1.POST("/patent", _api.Patent) + } // Technology 技术管理 technologyV1 := g.Group("/technology") {