update .gitignore
This commit is contained in:
70
.config.yaml
Normal file
70
.config.yaml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
name: 中科元
|
||||||
|
# domain 域名
|
||||||
|
domain: http://192.168.0.145:8000
|
||||||
|
# token有效时间(秒)
|
||||||
|
token_effect_time: 604800
|
||||||
|
# multiple_login 多地登录
|
||||||
|
multiple_login: true
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 8000
|
||||||
|
read_timeout: 5
|
||||||
|
write_timeout: 5
|
||||||
|
idle_timeout: 5
|
||||||
|
|
||||||
|
# RATE 限流器
|
||||||
|
rate:
|
||||||
|
# 每秒注入容器中数量
|
||||||
|
limit: 50
|
||||||
|
# 每个IP每秒请求最大次数
|
||||||
|
capacity: 100
|
||||||
|
|
||||||
|
# ENGINE 配置
|
||||||
|
engine:
|
||||||
|
# 开启会输出sql日志
|
||||||
|
debug: true
|
||||||
|
# db_mode - mysql | sqlite
|
||||||
|
db_mode: mysql
|
||||||
|
max_lifetime: 3600
|
||||||
|
max_open_conns: 2000
|
||||||
|
max_idle_conns: 1000
|
||||||
|
table_prefix:
|
||||||
|
# 是否采用数据表复数
|
||||||
|
complex: false
|
||||||
|
# MYSQL 配置
|
||||||
|
mysql:
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 3306
|
||||||
|
user: appuser
|
||||||
|
password: ABCabc01
|
||||||
|
db_name: sciences
|
||||||
|
parameters: charset=utf8mb4,utf8&parseTime=True&loc=Local
|
||||||
|
# SQLITE 配置
|
||||||
|
sqlite:
|
||||||
|
path: data
|
||||||
|
name: app.db
|
||||||
|
|
||||||
|
cache:
|
||||||
|
# memory | redis
|
||||||
|
type: redis
|
||||||
|
redis:
|
||||||
|
addr: "192.168.0.188:6379"
|
||||||
|
password: ABCabc01
|
||||||
|
db: 0
|
||||||
|
max_active: 0
|
||||||
|
max_idle: 1000
|
||||||
|
idle_timeout: 240
|
||||||
|
|
||||||
|
# UPLOAD 上传文件配置
|
||||||
|
upload:
|
||||||
|
path: upload/
|
||||||
|
ext: png,jpg,csv,xls,xlsx,pcm,wav,amr,mp3,mp4,json
|
||||||
|
# size 4<<20,不支持位运算,文件最大限制
|
||||||
|
size: 4194304
|
||||||
|
rename: true
|
||||||
|
|
||||||
|
#LOG 日志管理
|
||||||
|
log:
|
||||||
|
file: log/logs.log
|
||||||
|
least_day: 7
|
||||||
|
level: debug # debug | info | warn | error
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ SciencesServer
|
|||||||
upload/*
|
upload/*
|
||||||
log/*
|
log/*
|
||||||
cmd/ctl/ctl
|
cmd/ctl/ctl
|
||||||
|
./config.yaml
|
@ -34,6 +34,7 @@ type (
|
|||||||
InnovateDetailInfo struct {
|
InnovateDetailInfo struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
*model2.ServiceInnovate
|
*model2.ServiceInnovate
|
||||||
|
Tags []string `json:"tags"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -103,6 +104,7 @@ func (c *Innovate) Detail(id uint64) (*InnovateDetailInfo, error) {
|
|||||||
return &InnovateDetailInfo{
|
return &InnovateDetailInfo{
|
||||||
ID: mServiceInnovate.GetEncodeID(),
|
ID: mServiceInnovate.GetEncodeID(),
|
||||||
ServiceInnovate: mServiceInnovate.ServiceInnovate,
|
ServiceInnovate: mServiceInnovate.ServiceInnovate,
|
||||||
|
Tags: mServiceInnovate.GetTagAttribute(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@ func initModel() {
|
|||||||
&synchronized{iModel: model.NewTechnologyProject()}, &synchronized{iModel: model.NewTechnologyTopic()},
|
&synchronized{iModel: model.NewTechnologyProject()}, &synchronized{iModel: model.NewTechnologyTopic()},
|
||||||
&synchronized{iModel: model.NewServiceDocking()}, &synchronized{iModel: model.NewServiceMessage()},
|
&synchronized{iModel: model.NewServiceDocking()}, &synchronized{iModel: model.NewServiceMessage()},
|
||||||
&synchronized{iModel: model.NewServiceSolutionCase()}, &synchronized{iModel: model.NewServiceSolutionCaseDetail()},
|
&synchronized{iModel: model.NewServiceSolutionCase()}, &synchronized{iModel: model.NewServiceSolutionCaseDetail()},
|
||||||
|
&synchronized{iModel: model.NewServiceInnovate()}, &synchronized{iModel: model.NewServiceInnovateKind()},
|
||||||
// 活动管理
|
// 活动管理
|
||||||
&synchronized{iModel: model.NewActivityInstance()}, &synchronized{iModel: model.NewActivityApply()},
|
&synchronized{iModel: model.NewActivityInstance()}, &synchronized{iModel: model.NewActivityApply()},
|
||||||
&synchronized{iModel: model.NewActivityExamine()}, &synchronized{iModel: model.NewActivityJoin()},
|
&synchronized{iModel: model.NewActivityExamine()}, &synchronized{iModel: model.NewActivityJoin()},
|
||||||
|
33
app/common/model/service_innovate.go
Normal file
33
app/common/model/service_innovate.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
// ServiceInnovate 创新服务数据模型
|
||||||
|
type ServiceInnovate struct {
|
||||||
|
Model
|
||||||
|
Kind uint64 `gorm:"column:kind;type:int(11);default:0;comment:创新服务类型" json:"kind"`
|
||||||
|
Title string `gorm:"column:title;type:varchar(50);default:'';comment:创新服务标题" json:"title"`
|
||||||
|
Content string `gorm:"column:content;type:text;comment:创新服务内容" json:"content"`
|
||||||
|
Tag string `gorm:"column:tag;type:varchar(255);default:'';comment:创新服务标签" json:"-"`
|
||||||
|
ModelDeleted
|
||||||
|
ModelAt
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ServiceInnovate) TableName() string {
|
||||||
|
return "service_innovate"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ServiceInnovate) GetTagAttribute() []string {
|
||||||
|
out := make([]string, 0)
|
||||||
|
_ = json.Unmarshal([]byte(m.Tag), &out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ServiceInnovate) SetTagAttribute(value []string) {
|
||||||
|
_bytes, _ := json.Marshal(value)
|
||||||
|
m.Tag = string(_bytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServiceInnovate() *ServiceInnovate {
|
||||||
|
return &ServiceInnovate{}
|
||||||
|
}
|
18
app/common/model/service_innovate_kind.go
Normal file
18
app/common/model/service_innovate_kind.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
// ServiceInnovateKind 创新服务分类数据模型
|
||||||
|
type ServiceInnovateKind struct {
|
||||||
|
Model
|
||||||
|
Title string `gorm:"column:title;type:varchar(50);default:'';comment:创新服务分类标题" json:"title"`
|
||||||
|
Sort int `gorm:"column:sort;type:tinyint(1);default:0;comment:创新服务分类排序" json:"sort"`
|
||||||
|
ModelDeleted
|
||||||
|
ModelAt
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ServiceInnovateKind) TableName() string {
|
||||||
|
return "service_innovate_kind"
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServiceInnovateKind() *ServiceInnovateKind {
|
||||||
|
return &ServiceInnovateKind{}
|
||||||
|
}
|
@ -37,7 +37,7 @@ engine:
|
|||||||
host: 192.168.0.188
|
host: 192.168.0.188
|
||||||
port: 3306
|
port: 3306
|
||||||
user: appuser
|
user: appuser
|
||||||
password: ABCabc01!
|
password: ABCabc01
|
||||||
db_name: sciences
|
db_name: sciences
|
||||||
parameters: charset=utf8mb4,utf8&parseTime=True&loc=Local
|
parameters: charset=utf8mb4,utf8&parseTime=True&loc=Local
|
||||||
# SQLITE 配置
|
# SQLITE 配置
|
||||||
@ -50,8 +50,8 @@ cache:
|
|||||||
type: redis
|
type: redis
|
||||||
redis:
|
redis:
|
||||||
addr: "192.168.0.188:6379"
|
addr: "192.168.0.188:6379"
|
||||||
password: ABCabc01!
|
password: ABCabc01
|
||||||
db: 6
|
db: 0
|
||||||
max_active: 0
|
max_active: 0
|
||||||
max_idle: 1000
|
max_idle: 1000
|
||||||
idle_timeout: 240
|
idle_timeout: 240
|
||||||
|
BIN
file/.DS_Store
vendored
Normal file
BIN
file/.DS_Store
vendored
Normal file
Binary file not shown.
@ -56,7 +56,7 @@ func registerAPI(app *gin.Engine) {
|
|||||||
serviceV1.POST("/solution_case/list", _api.SolutionCaseList)
|
serviceV1.POST("/solution_case/list", _api.SolutionCaseList)
|
||||||
serviceV1.POST("/solution_case/detail", _api.SolutionCaseDetail)
|
serviceV1.POST("/solution_case/detail", _api.SolutionCaseDetail)
|
||||||
serviceV1.POST("/innovate", _api.Innovate)
|
serviceV1.POST("/innovate", _api.Innovate)
|
||||||
serviceV1.POST("/innovate/kind", _api.InnovateKind)
|
serviceV1.GET("/innovate/kind", _api.InnovateKind)
|
||||||
serviceV1.POST("/innovate/detail", _api.InnovateDetail)
|
serviceV1.POST("/innovate/detail", _api.InnovateDetail)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user