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