feat:完善项目信息

This commit is contained in:
henry
2022-01-21 11:42:58 +08:00
parent dda20eb011
commit 1c027dd2d1
23 changed files with 125 additions and 113 deletions

View File

@ -85,6 +85,10 @@ func (*Technology) PatentBind(c *gin.Context) {
api.APIResponse(err)(c)
}
func (*Technology) PatentExamine(c *gin.Context) {
}
func (*Technology) PatentDelete(c *gin.Context) {
form := new(api.IDStringForm)
@ -239,13 +243,39 @@ func (*Technology) AchievementDelete(c *gin.Context) {
}
func (*Technology) Demand(c *gin.Context) {
form := &struct {
api.TenantIDStringForm
Title string `json:"title" form:"title"`
Kind int `json:"kind" form:"kind"`
api.PageForm
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := technology.NewDemand()(api.GetSession()(c).(*session.Admin)).Instance(form.Convert(), form.Title, form.Kind,
form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
func (*Technology) DemandDetail(c *gin.Context) {
form := new(api.IDStringForm)
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := technology.NewDemand()(api.GetSession()(c).(*session.Admin)).Detail(form.Convert())
api.APIResponse(err, data)(c)
}
func (*Technology) DemandDelete() {
func (*Technology) DemandDelete(c *gin.Context) {
form := new(api.IDStringForm)
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := technology.NewDemand()(api.GetSession()(c).(*session.Admin)).Delete(form.Convert())
api.APIResponse(err)(c)
}

View File

@ -0,0 +1,7 @@
package technology
import model2 "SciencesServer/app/common/model"
func handleExamine(iModel model2.IModel, status int) {
}

View File

@ -230,6 +230,11 @@ func (c *Patent) Bind(id, uid uint64) error {
})
}
// Examine 审核操作
func (c *Patent) Examine() {
}
// Delete 删除操作
func (c *Patent) Delete(id uint64) error {
mSysPatent := model.NewSysPatent()

View File

@ -83,6 +83,29 @@ func (c *Product) Form() {
}
// Examine 审核操作
func (c *Product) Examine(id uint64, status int, remark string) error {
mTechnologyProduct := model.NewTechnologyProduct()
mTechnologyProduct.ID = id
isExist, err := model2.FirstField(mTechnologyProduct.TechnologyProduct, []string{"id", "tenant_id", "status"})
if err != nil {
return err
} else if !isExist {
return errors.New("操作错误,产品信息不存在或已被删除")
}
if c.TenantID > 0 && mTechnologyProduct.TenantID != c.TenantID {
return errors.New("操作错误,无权限操作")
}
if mTechnologyProduct.Status != model2.TechnologyStatusKindForExamining {
return errors.New("操作错误,当前产品状态不允许审核")
}
return model2.Updates(mTechnologyProduct.TechnologyProduct, map[string]interface{}{
"status": status,
})
}
// Delete 删除操作
func (c *Product) Delete(id uint64) error {
mTechnologyProduct := model.NewTechnologyProduct()

View File

@ -58,7 +58,7 @@ func (m *ManageExpert) Experts(page, pageSize int, count *int64, where ...*model
"LEFT JOIN (SELECT uid, COUNT(id) AS count FROM %s WHERE is_deleted = %d GROUP BY uid) AS u_p ON u.uid = u_p.uid "+
" WHERE u.is_deleted = %d AND u.invalid_status = %d GROUP BY u.expert_id) AS u ON e.id = u.expert_id",
model.NewUserExpert().TableName(),
model.NewTechnologyAchievement().TableName(), model.DeleteStatusForNot, model.TechnologyAchievementStatusForAgree,
model.NewTechnologyAchievement().TableName(), model.DeleteStatusForNot, model.TechnologyStatusKindForAgree,
model.NewUserPatent().TableName(), model.DeleteStatusForNot,
model.DeleteStatusForNot, model.InvalidStatusForNot)).
Where("e.is_deleted = ?", model.DeleteStatusForNot)

View File

@ -161,8 +161,8 @@ func (c *Achievement) Form(params *AchievementParams) error {
return errors.New("操作错误,成果信息不存在或已被删除")
} else if mTechnologyAchievement.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyAchievement.Status != model2.TechnologyAchievementStatusForRefuse &&
mTechnologyAchievement.Status != model2.TechnologyAchievementStatusForDraft {
} else if mTechnologyAchievement.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyAchievement.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -180,14 +180,14 @@ func (c *Achievement) Form(params *AchievementParams) error {
mTechnologyAchievement.Source = params.Source
if mTechnologyAchievement.ID > 0 {
mTechnologyAchievement.Status = model2.TechnologyAchievementStatusForExamining
mTechnologyAchievement.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyAchievement.TechnologyAchievement, mTechnologyAchievement.TechnologyAchievement)
}
mTechnologyAchievement.TenantID = c.tenantID
mTechnologyAchievement.UID = c.UID
if params.IsSubmit > 0 {
mTechnologyAchievement.Status = model2.TechnologyAchievementStatusForExamining
mTechnologyAchievement.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyAchievement.TechnologyAchievement)
}

View File

@ -119,8 +119,8 @@ func (c *Demand) Form(params *DemandParams) error {
return errors.New("操作错误,需求信息不存在或已被删除")
} else if mTechnologyDemand.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyDemand.Status != model2.TechnologyDemandStatusForRefuse &&
mTechnologyDemand.Status != model2.TechnologyDemandStatusForDraft {
} else if mTechnologyDemand.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyDemand.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -145,14 +145,14 @@ func (c *Demand) Form(params *DemandParams) error {
},
})
if mTechnologyDemand.ID > 0 {
mTechnologyDemand.Status = model2.TechnologyDemandStatusForExamining
mTechnologyDemand.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyDemand.TechnologyDemand, mTechnologyDemand.TechnologyDemand)
}
mTechnologyDemand.UID = c.UID
mTechnologyDemand.TenantID = c.tenantID
if params.IsSubmit > 0 {
mTechnologyDemand.Status = model2.TechnologyDemandStatusForExamining
mTechnologyDemand.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyDemand.TechnologyDemand)
}

View File

@ -78,8 +78,8 @@ func (c *Instance) Form(params *InstanceParams) error {
return errors.New("操作错误,技术信息不存在或已被删除")
} else if c.UID != mTechnologyInstance.UID {
return errors.New("操作错误,无权限操作")
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForDraft &&
mTechnologyInstance.Status != model2.TechnologyInstanceStatusForRefuse {
} else if mTechnologyInstance.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyInstance.Status != model2.TechnologyStatusKindForRefuse {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -99,19 +99,19 @@ func (c *Instance) Form(params *InstanceParams) error {
mTechnologyInstance.Purpose = params.Purpose
mTechnologyInstance.Remark = params.Remark
if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForDraft &&
mTechnologyInstance.Status != model2.TechnologyInstanceStatusForExamining {
if mTechnologyInstance.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyInstance.Status != model2.TechnologyStatusKindForExamining {
return errors.New("操作错误,状态参数错误")
}
if params.ID > 0 {
mTechnologyInstance.Status = model2.TechnologyInstanceStatusForExamining
mTechnologyInstance.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyInstance.TechnologyInstance, mTechnologyInstance.TechnologyInstance)
}
mTechnologyInstance.UID = c.UID
mTechnologyInstance.TenantID = c.tenantID
if params.IsSubmit > 0 {
mTechnologyInstance.Status = model2.TechnologyInstanceStatusForExamining
mTechnologyInstance.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyInstance.TechnologyInstance)
}
@ -128,7 +128,7 @@ func (c *Instance) Shelf(id uint64, status int) error {
return errors.New("信息不存在")
} else if c.UID != mTechnologyInstance.UID {
return errors.New("操作错误,无权限操作")
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree {
} else if mTechnologyInstance.Status != model2.TechnologyStatusKindForAgree {
return errors.New("操作错误,当前状态不允许处理上下架")
} else if mTechnologyInstance.Shelf.ShelfStatus == model2.ShelfStatusKind(status) {
return errors.New("操作错误,状态异常")

View File

@ -184,8 +184,8 @@ func (c *Product) Form(params *ProductParams) error {
return errors.New("操作错误,产品信息不存在或已被删除")
} else if mTechnologyProduct.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyProduct.Status != model2.TechnologyProductStatusForRefuse &&
mTechnologyProduct.Status != model2.TechnologyProductStatusForDraft {
} else if mTechnologyProduct.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyProduct.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -202,14 +202,14 @@ func (c *Product) Form(params *ProductParams) error {
mTechnologyProduct.Introduce = params.Introduce
if mTechnologyProduct.ID > 0 {
mTechnologyProduct.Status = model2.TechnologyProductStatusForExamining
mTechnologyProduct.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyProduct.TechnologyProduct, mTechnologyProduct.TechnologyProduct)
}
mTechnologyProduct.TenantID = c.tenantID
mTechnologyProduct.UID = c.UID
if params.IsSubmit > 0 {
mTechnologyProduct.Status = model2.TechnologyProductStatusForExamining
mTechnologyProduct.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyProduct.TechnologyProduct)
}

View File

@ -102,8 +102,8 @@ func (c *Topic) Form(params *TopicParams) error {
return errors.New("操作错误,课题信息不存在")
} else if mTechnologyTopic.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyTopic.Status != model2.TechnologyTopicStatusForDraft &&
mTechnologyTopic.Status != model2.TechnologyTopicStatusForRefuse {
} else if mTechnologyTopic.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyTopic.Status != model2.TechnologyStatusKindForRefuse {
return errors.New("操作错误,当前状态不允许修改")
}
}

View File

@ -46,7 +46,7 @@ func (m *TechnologyAchievement) Achievements(page, pageSize int, count *int64, w
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON a.id = c.object_id",
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Where("a.status = ?", model.TechnologyAchievementStatusForAgree).
Where("a.status = ?", model.TechnologyStatusKindForAgree).
Where("a.is_deleted = ?", model.DeleteStatusForNot)
if len(where) > 0 {

View File

@ -183,7 +183,7 @@ func (c *Index) static() (*InstanceStaticInfo, error) {
mTechnologyAchievement := model.NewTechnologyAchievement()
if err = model2.Count(mTechnologyAchievement.TechnologyAchievement, &out.AchievementCount, model2.NewWhere("shelf_status", model2.ShelfStatusForUp),
model2.NewWhere("status", model2.TechnologyAchievementStatusForAgree)); err != nil {
model2.NewWhere("status", model2.TechnologyStatusKindForAgree)); err != nil {
return nil, err
}
@ -197,7 +197,7 @@ func (c *Index) static() (*InstanceStaticInfo, error) {
mTechnologyDemand := model.NewTechnologyDemand()
if err = model2.Count(mTechnologyDemand.TechnologyDemand, &out.DemandCount,
model2.NewWhere("status", model2.TechnologyDemandStatusForAgree)); err != nil {
model2.NewWhere("status", model2.TechnologyStatusKindForAgree)); err != nil {
return nil, err
}
// 对接信息

View File

@ -43,7 +43,7 @@ func (c *Demand) Instance(title, industry, kind string, page, pageSize int) (*co
where := []*model2.ModelWhereOrder{
&model2.ModelWhereOrder{
Where: model2.NewWhere("status", model2.TechnologyDemandStatusForAgree),
Where: model2.NewWhere("status", model2.TechnologyStatusKindForAgree),
Order: model2.NewOrder("id", model2.OrderModeToDesc),
},
}

View File

@ -26,7 +26,7 @@ func (m *ManageCompany) Products(id, uid uint64, page, pageSize int, count *int6
Select("p.id", "p.title", "p.image", "p.industry", "p.maturity", "p.lead_standard", "p.cooperation_mode",
"p.keyword", "v.count AS visit_count", "c_u.id AS collect_id", "c.count AS collect_count").
Joins(fmt.Sprintf("LEFT JOIN %s AS p ON u_c.uid = p.uid AND p.shelf_status = %d AND p.status = %d AND p.is_deleted = %d",
model.NewTechnologyProduct().TableName(), model.ShelfStatusForUp, model.TechnologyProductStatusForAgree, model.DeleteStatusForNot)).
model.NewTechnologyProduct().TableName(), model.ShelfStatusForUp, model.TechnologyStatusKindForAgree, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, SUM(count) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS v ON p.id = v.object_id",
model.NewUserVisit().TableName(), model.UserVisitKindForTechnologyProduct, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON p.id = c.object_id",

View File

@ -26,7 +26,7 @@ func (m *TechnologyAchievement) Achievements(page, pageSize int, count *int64, w
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON a.id = c.object_id",
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Where("a.status = ?", model.TechnologyAchievementStatusForAgree).
Where("a.status = ?", model.TechnologyStatusKindForAgree).
Where("a.is_deleted = ?", model.DeleteStatusForNot)
if len(where) > 0 {
@ -54,7 +54,7 @@ func (m *TechnologyAchievement) Achievement(where ...*model.ModelWhere) ([]*Tech
model.NewUserVisit().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN (SELECT object_id, COUNT(id) AS count FROM %s WHERE kind = %d AND is_deleted = %d GROUP BY object_id) AS c ON a.id = c.object_id",
model.NewUserCollect().TableName(), model.UserCollectKindForTechnologyAchievement, model.DeleteStatusForNot)).
Where("a.status = ?", model.TechnologyAchievementStatusForAgree).
Where("a.status = ?", model.TechnologyStatusKindForAgree).
Where("a.is_deleted = ?", model.DeleteStatusForNot)
out := make([]*TechnologyAchievementInfo, 0)
@ -99,7 +99,7 @@ func (m *TechnologyAchievement) Distribution() ([]*DataAreaDistributionInfo, err
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON u_e.expert_id = e.id", model.NewManageExpert().TableName())).
Group("e.province").Group("e.city").Group("e.district").
Order("e.province "+model.OrderModeToAsc).Order("e.city "+model.OrderModeToAsc).Order("e.district "+model.OrderModeToAsc).
Where("a.status = ?", model.TechnologyAchievementStatusForAgree).
Where("a.status = ?", model.TechnologyStatusKindForAgree).
Where("a.shelf_status = ?", model.ShelfStatusForUp).
Scan(&out).Error

View File

@ -24,7 +24,7 @@ func (m *TechnologyDemand) Demand(page, pageSize int, count *int64, where ...*mo
Joins(fmt.Sprintf("LEFT JOIN %s AS u_c ON d.uid = u_c.uid AND u_c.is_deleted = %d",
model.NewUserCompany().TableName(), model.DeleteStatusForNot)).
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON u_c.company_id = c.id", model.NewManageCompany().TableName())).
Where("d.status = ?", model.TechnologyDemandStatusForAgree)
Where("d.status = ?", model.TechnologyStatusKindForAgree)
if len(where) > 0 {
for _, v := range where {
@ -50,7 +50,7 @@ func (m *TechnologyDemand) Distribution() ([]*DataAreaDistributionInfo, error) {
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON u_e.expert_id = e.id", model.NewManageExpert().TableName())).
Group("e.province").Group("e.city").Group("e.district").
Order("e.province "+model.OrderModeToAsc).Order("e.city "+model.OrderModeToAsc).Order("e.district "+model.OrderModeToAsc).
Where("d.status = ?", model.TechnologyDemandStatusForAgree).
Where("d.status = ?", model.TechnologyStatusKindForAgree).
Scan(&out).Error
return out, err

View File

@ -117,6 +117,24 @@ const (
InvalidStatusForNot
)
// TechnologyStatus 科技信息状态
type TechnologyStatus struct {
Status TechnologyStatusKind `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
}
type TechnologyStatusKind int
const (
// TechnologyStatusKindForDraft 草稿箱
TechnologyStatusKindForDraft TechnologyStatusKind = iota
// TechnologyStatusKindForExamining 审核中
TechnologyStatusKindForExamining
// TechnologyStatusKindForAgree 审核通过
TechnologyStatusKindForAgree
// TechnologyStatusKindForRefuse 审核拒绝
TechnologyStatusKindForRefuse
)
type Area struct {
Province string `gorm:"column:province;type:varchar(8);default:'';comment:所在省" json:"province"`
City string `gorm:"column:city;type:varchar(8);default:'';comment:所在市" json:"city"`

View File

@ -24,7 +24,7 @@ type TechnologyAchievement struct {
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
Source string `gorm:"source:introduce;type:text;comment:成果来源" json:"source"`
Shelf
Status TechnologyAchievementStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
TechnologyStatus
ModelDeleted
ModelAt
}
@ -46,20 +46,6 @@ const (
TechnologyAchievementModeForCharge
)
// TechnologyAchievementStatus 技术成果状态
type TechnologyAchievementStatus int
const (
// TechnologyAchievementStatusForDraft 草稿箱
TechnologyAchievementStatusForDraft TechnologyAchievementStatus = iota
// TechnologyAchievementStatusForExamining 审核中
TechnologyAchievementStatusForExamining
// TechnologyAchievementStatusForAgree 审核通过
TechnologyAchievementStatusForAgree
// TechnologyAchievementStatusForRefuse 审核拒绝
TechnologyAchievementStatusForRefuse
)
func (m *TechnologyAchievement) TableName() string {
return "technology_achievement"
}

View File

@ -21,7 +21,7 @@ type TechnologyDemand struct {
BudgetMode TechnologyDemandBudgetMode `gorm:"column:budget_mode;type:tinyint(1);default:1;comment:预算模式1具体金额2面议" json:"budget_mode"`
Deadline time.Time `gorm:"column:deadline;type:date;not null;comment:截止时间" json:"deadline"`
Other string `gorm:"column:other;type:varchar(255);default:'';comment:其他信息" json:"-"`
Status TechnologyDemandStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
TechnologyStatus
ModelDeleted
ModelAt
}
@ -46,20 +46,6 @@ const (
TechnologyDemandBudgetModeForToFace
)
// TechnologyDemandStatus 需求文档状态
type TechnologyDemandStatus int
const (
// TechnologyDemandStatusForDraft 草稿箱
TechnologyDemandStatusForDraft TechnologyDemandStatus = iota
// TechnologyDemandStatusForExamining 审核中
TechnologyDemandStatusForExamining
// TechnologyDemandStatusForAgree 审核通过
TechnologyDemandStatusForAgree
// TechnologyDemandStatusForRefuse 审核拒绝
TechnologyDemandStatusForRefuse
)
func (m *TechnologyDemand) TableName() string {
return m.NewTableName("technology_demand")
}

View File

@ -26,7 +26,7 @@ type TechnologyInstance struct {
Purpose string `gorm:"column:purpose;type:text;comment:意图-承担科研项目" json:"purpose"`
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`
Shelf
Status TechnologyInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
TechnologyStatus
ModelDeleted
ModelAt
}
@ -47,20 +47,6 @@ const (
TechnologyInstanceSourceForOther
)
// TechnologyInstanceStatus 技术文档状态
type TechnologyInstanceStatus int
const (
// TechnologyInstanceStatusForDraft 草稿箱
TechnologyInstanceStatusForDraft TechnologyInstanceStatus = iota
// TechnologyInstanceStatusForExamining 审核中
TechnologyInstanceStatusForExamining
// TechnologyInstanceStatusForAgree 审核通过
TechnologyInstanceStatusForAgree
// TechnologyInstanceStatusForRefuse 审核拒绝
TechnologyInstanceStatusForRefuse
)
func (m *TechnologyInstance) TableName() string {
return m.NewTableName("technology_instance")
}

View File

@ -22,7 +22,7 @@ type TechnologyProduct struct {
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"-"`
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
Shelf
Status TechnologyProductStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
TechnologyStatus
ModelDeleted
ModelAt
}
@ -41,20 +41,6 @@ const (
TechnologyProductLeadStandardForInternationalLX
)
// TechnologyProductStatus 状态
type TechnologyProductStatus int
const (
// TechnologyProductStatusForDraft 草稿箱
TechnologyProductStatusForDraft TechnologyProductStatus = iota
// TechnologyProductStatusForExamining 审核中
TechnologyProductStatusForExamining
// TechnologyProductStatusForAgree 审核通过
TechnologyProductStatusForAgree
// TechnologyProductStatusForRefuse 审核拒绝
TechnologyProductStatusForRefuse
)
// TechnologyProductShelfStatus 上下架状态
type TechnologyProductShelfStatus int

View File

@ -20,7 +20,7 @@ type TechnologyTopic struct {
Kind TechnologyTopicKind `gorm:"column:kind;type:tinyint(1);default:0;comment:类型" json:"kind"`
BeginAt time.Time `gorm:"column:begin_at;type:datetime;not null;comment:开始时间" json:"begin_at"`
FinishAt time.Time `gorm:"column:finish_at;type:datetime;not null;comment:结束时间" json:"finish_at"`
Status TechnologyTopicStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
TechnologyStatus
ModelDeleted
ModelAt
}
@ -40,24 +40,6 @@ const (
// TechnologyTopicKind 技术课题类型
type TechnologyTopicKind int
const (
//TechnologyTopicKindFor
)
// TechnologyTopicStatus 技术课题状态
type TechnologyTopicStatus int
const (
// TechnologyTopicStatusForDraft 草稿箱
TechnologyTopicStatusForDraft TechnologyTopicStatus = iota
// TechnologyTopicStatusForExamining 审核中
TechnologyTopicStatusForExamining
// TechnologyTopicStatusForAgree 审核通过
TechnologyTopicStatusForAgree
// TechnologyTopicStatusForRefuse 审核拒绝
TechnologyTopicStatusForRefuse
)
func (m *TechnologyTopic) TableName() string {
return m.NewTableName("technology_topic")
}