增加社区列表接口,任务相关接口修改

This commit is contained in:
lianghuanjie
2024-12-19 21:14:14 +08:00
parent 391a9d3481
commit a3c4adfa25
32 changed files with 1163 additions and 197 deletions

View File

@@ -3,9 +3,11 @@ package main
import (
"flag"
"fmt"
"github.com/zeromicro/go-zero/core/service"
"nova_task/internal/config"
"nova_task/internal/handler"
"nova_task/internal/job"
"nova_task/internal/pkg/errs"
"nova_task/internal/svc"
"github.com/zeromicro/go-zero/core/conf"
@@ -21,14 +23,19 @@ func main() {
conf.MustLoad(*configFile, &c)
c.MustSetUp()
server := rest.MustNewServer(c.RestConf)
defer server.Stop()
ctx := svc.NewServiceContext(c)
defer ctx.Close()
handler.RegisterHandlers(server, ctx)
serviceGroup := service.NewServiceGroup()
defer serviceGroup.Stop()
jb := job.NewJob(ctx)
serviceGroup.Add(jb)
httpSvr := rest.MustNewServer(c.RestConf, rest.WithCors(), errs.WithUnauthorizedCallback())
handler.RegisterHandlers(httpSvr, ctx)
serviceGroup.Add(httpSvr)
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
server.Start()
serviceGroup.Start()
}