no message
parent
e177f9d138
commit
fa6bf72e80
|
@ -104,7 +104,6 @@ func RangeWidget(p *Widget ) string{
|
||||||
ret += RangeWidget(tmp)
|
ret += RangeWidget(tmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// log.Print(ret)
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,6 +221,7 @@ func GetXmlController(path io.Reader) string{
|
||||||
case xml.StartElement:
|
case xml.StartElement:
|
||||||
if(list.Len() == 0){
|
if(list.Len() == 0){
|
||||||
ins := new(Controller)
|
ins := new(Controller)
|
||||||
|
ins.Type = startElement.Name.Local
|
||||||
ins.Name = getAttr("name",startElement.Attr)
|
ins.Name = getAttr("name",startElement.Attr)
|
||||||
ins.Parent = nil
|
ins.Parent = nil
|
||||||
list.PushBack(ins)
|
list.PushBack(ins)
|
||||||
|
@ -240,7 +240,8 @@ func GetXmlController(path io.Reader) string{
|
||||||
}
|
}
|
||||||
begin := list.Front()
|
begin := list.Front()
|
||||||
first := true
|
first := true
|
||||||
|
fatherType := begin.Value.(*Controller).Type
|
||||||
|
log.Print(begin.Value.(*Controller).Type)
|
||||||
|
|
||||||
for begin.Next() != nil{
|
for begin.Next() != nil{
|
||||||
if begin.Value.(*Controller).Name != ""{
|
if begin.Value.(*Controller).Name != ""{
|
||||||
|
@ -280,13 +281,22 @@ func GetXmlController(path io.Reader) string{
|
||||||
}else{
|
}else{
|
||||||
maps[begin.Value.(*Controller).Type] = 1
|
maps[begin.Value.(*Controller).Type] = 1
|
||||||
}
|
}
|
||||||
|
if(fatherType == "Window"){
|
||||||
ret += fmt.Sprintf("ui::%s * m_%s_%d = dynamic_cast<ui::%s*>(FindControl(L\"%s\"))\r\n",
|
ret += fmt.Sprintf("ui::%s * m_%s_%d = dynamic_cast<ui::%s*>(FindControl(L\"%s\"));\r\n",
|
||||||
begin.Value.(*Controller).Type,
|
begin.Value.(*Controller).Type,
|
||||||
utils.ToSnakeString(begin.Value.(*Controller).Type),
|
utils.ToSnakeString(begin.Value.(*Controller).Type),
|
||||||
maps[begin.Value.(*Controller).Type],
|
maps[begin.Value.(*Controller).Type],
|
||||||
begin.Value.(*Controller).Type,
|
begin.Value.(*Controller).Type,
|
||||||
begin.Value.(*Controller).Name)
|
begin.Value.(*Controller).Name)
|
||||||
|
}
|
||||||
|
if(fatherType == "ChildBox"){
|
||||||
|
ret += fmt.Sprintf("ui::%s * m_%s_%d = dynamic_cast<ui::%s*>(FindSubControl(L\"%s\"));\r\n",
|
||||||
|
begin.Value.(*Controller).Type,
|
||||||
|
utils.ToSnakeString(begin.Value.(*Controller).Type),
|
||||||
|
maps[begin.Value.(*Controller).Type],
|
||||||
|
begin.Value.(*Controller).Type,
|
||||||
|
begin.Value.(*Controller).Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
begin = begin.Next()
|
begin = begin.Next()
|
||||||
|
@ -310,3 +320,5 @@ func (this *OpenApiController) DuilibXml2Cpp(c *gin.Context) {
|
||||||
log.Print(ret)
|
log.Print(ret)
|
||||||
c.String(200,ret)
|
c.String(200,ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ import (
|
||||||
type PlanController struct {
|
type PlanController struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) GetPlan(c *gin.Context) {
|
func (t *PlanController) GetPlan(c *gin.Context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) GetPlanDates(c *gin.Context) {
|
func (t *PlanController) GetPlanDates(c *gin.Context) {
|
||||||
type Req struct {
|
type Req struct {
|
||||||
Date string `json:"date"`
|
Date string `json:"date"`
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func (this *PlanController) GetPlanDates(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) AddPlan(c *gin.Context) {
|
func (t *PlanController) AddPlan(c *gin.Context) {
|
||||||
var req model.Plan
|
var req model.Plan
|
||||||
resp := RespBase{Msg: "r", Status: 0, Data: nil}
|
resp := RespBase{Msg: "r", Status: 0, Data: nil}
|
||||||
defer c.JSON(200, &resp)
|
defer c.JSON(200, &resp)
|
||||||
|
@ -65,7 +65,7 @@ func (this *PlanController) AddPlan(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) DelPlan(c *gin.Context) {
|
func (t *PlanController) DelPlan(c *gin.Context) {
|
||||||
resp := RespBase{Msg: "r", Status: 0, Data: nil}
|
resp := RespBase{Msg: "r", Status: 0, Data: nil}
|
||||||
defer c.JSON(200, &resp)
|
defer c.JSON(200, &resp)
|
||||||
var e error
|
var e error
|
||||||
|
@ -99,7 +99,7 @@ func (m *ReqDate) TableName() string {
|
||||||
return "plan"
|
return "plan"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) PlanDay(c *gin.Context) {
|
func (t *PlanController) PlanDay(c *gin.Context) {
|
||||||
var req ReqDate
|
var req ReqDate
|
||||||
resp := RespBase{
|
resp := RespBase{
|
||||||
Msg: "ERROR",
|
Msg: "ERROR",
|
||||||
|
@ -125,7 +125,7 @@ func (this *PlanController) PlanDay(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) Types(c *gin.Context) {
|
func (t *PlanController) Types(c *gin.Context) {
|
||||||
resp := RespBase{
|
resp := RespBase{
|
||||||
Msg: "ERROR",
|
Msg: "ERROR",
|
||||||
Status: 23,
|
Status: 23,
|
||||||
|
@ -142,7 +142,7 @@ func (this *PlanController) Types(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) CreateUndo(c *gin.Context) {
|
func (t *PlanController) CreateUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -166,7 +166,7 @@ func (this *PlanController) CreateUndo(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) UnFinishUndo(c *gin.Context) {
|
func (t *PlanController) UnFinishUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -183,7 +183,7 @@ func (this *PlanController) UnFinishUndo(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) FinishUndo(c *gin.Context) {
|
func (t *PlanController) FinishUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -203,7 +203,7 @@ func (this *PlanController) FinishUndo(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) UpdateUndo(c *gin.Context) {
|
func (t *PlanController) UpdateUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -224,7 +224,7 @@ func (this *PlanController) UpdateUndo(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) GetDone(c *gin.Context) {
|
func (t *PlanController) GetDone(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -240,7 +240,7 @@ func (this *PlanController) GetDone(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) GetUndo(c *gin.Context) {
|
func (t *PlanController) GetUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
@ -256,7 +256,7 @@ func (this *PlanController) GetUndo(c *gin.Context) {
|
||||||
resp.Status = 0
|
resp.Status = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) GetPageUndo(c *gin.Context) {
|
func (t *PlanController) GetPageUndo(c *gin.Context) {
|
||||||
type ReqGetPageUndo struct {
|
type ReqGetPageUndo struct {
|
||||||
}
|
}
|
||||||
var req ReqGetPageUndo
|
var req ReqGetPageUndo
|
||||||
|
@ -283,7 +283,7 @@ func (this *PlanController) GetPageUndo(c *gin.Context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlanController) DeleteUndo(c *gin.Context) {
|
func (t *PlanController) DeleteUndo(c *gin.Context) {
|
||||||
resp := RespBase{}
|
resp := RespBase{}
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(200, resp)
|
c.JSON(200, resp)
|
||||||
|
|
|
@ -109,7 +109,6 @@ func Init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InitELK()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitELK() {
|
func InitELK() {
|
||||||
|
@ -121,6 +120,8 @@ func InitELK() {
|
||||||
elastic.SetSniff(false),
|
elastic.SetSniff(false),
|
||||||
elastic.SetBasicAuth(elkconf.User, elkconf.Password),
|
elastic.SetBasicAuth(elkconf.User, elkconf.Password),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
log.Print("init elk cli is ",gElkEngine.cli,elkconf)
|
||||||
if nil != e {
|
if nil != e {
|
||||||
logs.Error(e.Error())
|
logs.Error(e.Error())
|
||||||
gElkEngine.cli = nil
|
gElkEngine.cli = nil
|
||||||
|
|
3
main.go
3
main.go
|
@ -38,7 +38,7 @@ func CORSMiddleware(c *gin.Context) {
|
||||||
if config.ApiConfig().RunMode == "release" {
|
if config.ApiConfig().RunMode == "release" {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
|
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
|
||||||
} else {
|
} else {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://127.0.0.1:8080")
|
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://127.0.0.1")
|
||||||
}
|
}
|
||||||
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
||||||
|
@ -113,6 +113,7 @@ func main() {
|
||||||
InitLogs()
|
InitLogs()
|
||||||
InitRedisConfig()
|
InitRedisConfig()
|
||||||
InitMysql()
|
InitMysql()
|
||||||
|
db.InitELK()
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
store := sessions.NewCookieStore([]byte("secret123"))
|
store := sessions.NewCookieStore([]byte("secret123"))
|
||||||
|
|
|
@ -155,7 +155,7 @@ func PortDocumentToElasticsearch(tblname string) error {
|
||||||
"analysis": map[string]interface{}{
|
"analysis": map[string]interface{}{
|
||||||
"analyzer": map[string]interface{}{
|
"analyzer": map[string]interface{}{
|
||||||
"default": map[string]interface{}{
|
"default": map[string]interface{}{
|
||||||
"type": "ik_max_word",
|
"type": "smartcn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue