From c5c273f0ab70085b88a042a054138ce1167b2048 Mon Sep 17 00:00:00 2001 From: hxt Date: Sat, 21 Jun 2025 20:12:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(hero):=20=E6=96=B0=E5=A2=9E=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E5=92=8C=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增英雄信息获取接口和相关逻辑 - 实现英雄列表和详情查询功能- 添加英雄相关数据结构和VO对象 - 更新项目结构,移除不必要的文件 --- api/hello/v1/hello.go | 12 -- api/hello/v1/hero.go | 12 -- api/{hello/hello.go => hero/hero.go} | 10 +- api/hero/v1/hero.go | 30 +++++ api/hero/v1/vo.go | 99 +++++++++++++++++ go.mod | 7 +- go.sum | 5 +- hack/config.yaml | 1 - internal/cmd/cmd.go | 6 +- internal/controller/hello/hello_v1_hello.go | 13 --- .../{hello/hello.go => hero/hero.go} | 2 +- .../{hello/hello_new.go => hero/hero_new.go} | 9 +- internal/controller/hero/hero_v1.go | 45 ++++++++ internal/logic/hero/hero.go | 103 ++++++++++++++++++ internal/logic/logic.go | 9 ++ internal/service/hero.go | 34 ++++++ main.go | 3 +- manifest/config/config.yaml | 23 ++++ manifest/docker/Dockerfile | 17 ++- 19 files changed, 374 insertions(+), 66 deletions(-) delete mode 100644 api/hello/v1/hello.go delete mode 100644 api/hello/v1/hero.go rename api/{hello/hello.go => hero/hero.go} (54%) create mode 100644 api/hero/v1/hero.go create mode 100644 api/hero/v1/vo.go delete mode 100644 internal/controller/hello/hello_v1_hello.go rename internal/controller/{hello/hello.go => hero/hero.go} (94%) rename internal/controller/{hello/hello_new.go => hero/hero_new.go} (62%) create mode 100644 internal/controller/hero/hero_v1.go create mode 100644 internal/logic/hero/hero.go create mode 100644 internal/logic/logic.go create mode 100644 internal/service/hero.go create mode 100644 manifest/config/config.yaml diff --git a/api/hello/v1/hello.go b/api/hello/v1/hello.go deleted file mode 100644 index b4dd233..0000000 --- a/api/hello/v1/hello.go +++ /dev/null @@ -1,12 +0,0 @@ -package v1 - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -type HelloReq struct { - g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"` -} -type HelloRes struct { - g.Meta `mime:"text/html" example:"string"` -} diff --git a/api/hello/v1/hero.go b/api/hello/v1/hero.go deleted file mode 100644 index 669b47c..0000000 --- a/api/hello/v1/hero.go +++ /dev/null @@ -1,12 +0,0 @@ -package v1 - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -type HeroReq struct { - g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"` -} -type HeroRes struct { - g.Meta `mime:"text/html" example:"string"` -} diff --git a/api/hello/hello.go b/api/hero/hero.go similarity index 54% rename from api/hello/hello.go rename to api/hero/hero.go index 74d6ee0..ba53952 100644 --- a/api/hello/hello.go +++ b/api/hero/hero.go @@ -2,14 +2,14 @@ // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. // ================================================================================= -package hello +package hero import ( "context" - - "epic/api/hello/v1" + v1 "epic/api/hero/v1" ) -type IHelloV1 interface { - Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) +type IHeroV1 interface { + GetOne(ctx context.Context, req *v1.GetOneReq) (res *v1.GetOneRes, err error) + GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) } diff --git a/api/hero/v1/hero.go b/api/hero/v1/hero.go new file mode 100644 index 0000000..031384d --- /dev/null +++ b/api/hero/v1/hero.go @@ -0,0 +1,30 @@ +package v1 + +import ( + "epic/internal/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +type GetOneReq struct { + g.Meta `path:"/getOne" method:"get" tags:"Hero" summary:"Get one hero"` + Code string `v:"required" dc:"角色code"` +} +type GetOneRes struct { + *entity.EpicHeroInfo +} + +// GetListReq GetListRes 列表返回所有角色 +type GetListReq struct { + g.Meta `path:"/getList" method:"get" tags:"Hero" summary:"Get all hero"` +} +type GetListRes struct { + Records []*EpicHeroVO `json:"list"` // ✅ 返回一个数组 +} + +type GetDetailReq struct { + g.Meta `path:"/getDetail" method:"get" tags:"Hero" summary:"Get hero detail by code"` + Code string `v:"required" dc:"角色code"` +} +type GetDetailRes struct { + Data *HeroDetailVO `json:"data"` +} diff --git a/api/hero/v1/vo.go b/api/hero/v1/vo.go new file mode 100644 index 0000000..000f74a --- /dev/null +++ b/api/hero/v1/vo.go @@ -0,0 +1,99 @@ +package v1 + +type EpicHeroVO struct { + Id int64 `json:"id" orm:"id" description:"文件编号"` // 文件编号 + HeroName string `json:"heroName" orm:"hero_name" description:"配置编号"` // 配置编号 + HeroCode string `json:"heroCode" orm:"hero_code" description:"文件名"` // 文件名 + HeroAttrLv60 string `json:"heroAttrLv60" orm:"hero_attr_lv60" description:"文件路径"` // 文件路径 + NickName string `json:"nickName" orm:"nick_name" description:"配置编号"` // 配置编号 + Rarity string `json:"rarity" orm:"rarity" description:"配置编号"` // 配置编号 + Role string `json:"role" orm:"role" description:"配置编号"` // 配置编号 + Zodiac string `json:"zodiac" orm:"zodiac" description:"配置编号"` // 配置编号 + HeadImgUrl string `json:"headImgUrl" orm:"head_img_url" description:"配置编号"` // 配置编号 + Attribute string `json:"attribute" orm:"attribute" description:"配置编号"` // 配置编号 + Remark string `json:"remark" orm:"remark" description:"配置编号"` // 配置编号 +} + +// HeroRespSimpleVO 简要信息 +type HeroRespSimpleVO struct { + Id string `json:"id"` + HeroCode string `json:"heroCode"` + HeroName string `json:"heroName"` + NickName string `json:"nickName"` + HeadImgUrl string `json:"headImgUrl"` + Stars int `json:"stars"` + Role string `json:"role"` + Attribute string `json:"attribute"` +} + +// Hero60AttributeVO 基础属性 +type Hero60AttributeVO struct { + Cp int `json:"cp"` + Atk int `json:"atk"` + Hp int `json:"hp"` + Spd int `json:"spd"` + Def int `json:"def"` + Chc float64 `json:"chc"` + Chd float64 `json:"chd"` + Dac float64 `json:"dac"` + Eff float64 `json:"eff"` + Efr float64 `json:"efr"` +} + +// HeroSetAvgVO 平均属性 +type HeroSetAvgVO struct { + Cp int `json:"cp"` + Atk int `json:"atk"` + Hp int `json:"hp"` + Spd int `json:"spd"` + Def int `json:"def"` + Chc float64 `json:"chc"` + Chd float64 `json:"chd"` + Dac float64 `json:"dac"` + Eff float64 `json:"eff"` + Efr float64 `json:"efr"` +} + +// HeroSetPercentVO 套装百分比 +type HeroSetPercentVO struct { + SetName string `json:"setName"` + Percent float64 `json:"percent"` +} + +// HeroArtifactPercentVO 神器百分比 +type HeroArtifactPercentVO struct { + ArtifactCode string `json:"artifactCode"` + ArtifactName string `json:"artifactName"` + Rarity string `json:"rarity"` + Role string `json:"role"` + ImageUrl string `json:"imageUrl"` + Percent float64 `json:"percent"` +} + +// HeroSetShowVO 展示用的装备数据 +type HeroSetShowVO struct { + Cp int `json:"cp"` + Atk int `json:"atk"` + Hp int `json:"hp"` + Spd int `json:"spd"` + Def int `json:"def"` + Chc float64 `json:"chc"` + Chd float64 `json:"chd"` + Dac float64 `json:"dac"` + Eff float64 `json:"eff"` + Efr float64 `json:"efr"` + Hds string `json:"hds"` + Ctr string `json:"ctr"` + ArfName string `json:"arfName"` + ArfPic string `json:"arfPic"` +} + +// HeroDetailVO 角色详情主对象 +type HeroDetailVO struct { + HeroRespSimpleVO *HeroRespSimpleVO `json:"heroRespSimpleVO"` + Hero60AttributeVO *Hero60AttributeVO `json:"hero60AttributeVO"` + HeroSetAvgVO *HeroSetAvgVO `json:"heroSetAvgVO"` + HeroSetPercentVOS []*HeroSetPercentVO `json:"heroSetPercentVOS"` + HeroArtifactPercentVOS []*HeroArtifactPercentVO `json:"heroArtifactPercentVOS"` + HeroSetShows []*HeroSetShowVO `json:"heroSetShows"` +} diff --git a/go.mod b/go.mod index 21290f1..de22462 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,10 @@ go 1.22 toolchain go1.24.4 -require github.com/gogf/gf/v2 v2.9.0 +require ( + github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0 + github.com/gogf/gf/v2 v2.9.0 +) require ( github.com/BurntSushi/toml v1.4.0 // indirect @@ -14,10 +17,10 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grokify/html-strip-tags-go v0.1.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index 76f7aa2..568eef4 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,6 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0 github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -16,6 +15,10 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0 h1:1f7EeD0lfPHoXfaJDSL7cxRcSRelbsAKgF3MGXY+Uyo= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0/go.mod h1:tToO1PjGkLIR+9DbJ0wrKicYma0H/EUHXOpwel6Dw+0= github.com/gogf/gf/v2 v2.9.0 h1:semN5Q5qGjDQEv4620VzxcJzJlSD07gmyJ9Sy9zfbHk= github.com/gogf/gf/v2 v2.9.0/go.mod h1:sWGQw+pLILtuHmbOxoe0D+0DdaXxbleT57axOLH2vKI= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= diff --git a/hack/config.yaml b/hack/config.yaml index cd94c2a..958971f 100644 --- a/hack/config.yaml +++ b/hack/config.yaml @@ -1,4 +1,3 @@ - # CLI tool, only in development environment. # https://goframe.org/docs/cli gfcli: diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index e62b135..e861223 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -2,12 +2,10 @@ package cmd import ( "context" - + "epic/internal/controller/hero" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/os/gcmd" - - "epic/internal/controller/hello" ) var ( @@ -20,7 +18,7 @@ var ( s.Group("/", func(group *ghttp.RouterGroup) { group.Middleware(ghttp.MiddlewareHandlerResponse) group.Bind( - hello.NewV1(), + hero.NewV1(), ) }) s.Run() diff --git a/internal/controller/hello/hello_v1_hello.go b/internal/controller/hello/hello_v1_hello.go deleted file mode 100644 index 69d4ae6..0000000 --- a/internal/controller/hello/hello_v1_hello.go +++ /dev/null @@ -1,13 +0,0 @@ -package hello - -import ( - "context" - "github.com/gogf/gf/v2/frame/g" - - "epic/api/hello/v1" -) - -func (c *ControllerV1) Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) { - g.RequestFromCtx(ctx).Response.Writeln("Hello World!") - return -} diff --git a/internal/controller/hello/hello.go b/internal/controller/hero/hero.go similarity index 94% rename from internal/controller/hello/hello.go rename to internal/controller/hero/hero.go index f72082f..c102dba 100644 --- a/internal/controller/hello/hello.go +++ b/internal/controller/hero/hero.go @@ -2,4 +2,4 @@ // This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. // ================================================================================= -package hello +package hero diff --git a/internal/controller/hello/hello_new.go b/internal/controller/hero/hero_new.go similarity index 62% rename from internal/controller/hello/hello_new.go rename to internal/controller/hero/hero_new.go index 13b54cf..ec80787 100644 --- a/internal/controller/hello/hello_new.go +++ b/internal/controller/hero/hero_new.go @@ -1,16 +1,15 @@ // ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. // ================================================================================= -package hello +package hero import ( - "epic/api/hello" + "epic/api/hero" ) type ControllerV1 struct{} -func NewV1() hello.IHelloV1 { +func NewV1() hero.IHeroV1 { return &ControllerV1{} } - diff --git a/internal/controller/hero/hero_v1.go b/internal/controller/hero/hero_v1.go new file mode 100644 index 0000000..ae4a1a4 --- /dev/null +++ b/internal/controller/hero/hero_v1.go @@ -0,0 +1,45 @@ +// internal/controller/hero/hero_v1.go +package hero + +import ( + "context" + "epic/api/hero/v1" + "epic/internal/service" +) + +func (c *ControllerV1) GetOne(ctx context.Context, req *v1.GetOneReq) (res *v1.GetOneRes, err error) { + hero, err := service.Hero().GetHeroByCode(ctx, req.Code) + if err != nil { + return nil, err + } + res = &v1.GetOneRes{ + EpicHeroInfo: hero, + } + return res, nil +} + +func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) { + // 获取 VO 列表 + list, err := service.Hero().GetHeroList(ctx) + if err != nil { + return nil, err + } + + // 构造响应 + res = &v1.GetListRes{ + Records: list, // ✅ 正确赋值字段 + } + return res, nil +} + +func (c *ControllerV1) GetDetail(ctx context.Context, req *v1.GetDetailReq) (res *v1.GetDetailRes, err error) { + detail, err := service.Hero().GetHeroDetailByCode(ctx, req.Code) + if err != nil { + return nil, err + } + + res = &v1.GetDetailRes{ + Data: detail, + } + return res, nil +} diff --git a/internal/logic/hero/hero.go b/internal/logic/hero/hero.go new file mode 100644 index 0000000..e498a86 --- /dev/null +++ b/internal/logic/hero/hero.go @@ -0,0 +1,103 @@ +package hero + +import ( + "context" + v1 "epic/api/hero/v1" + "epic/internal/dao" + "epic/internal/model/entity" + "epic/internal/service" + "github.com/gogf/gf/v2/frame/g" +) + +type Logic struct{} + +func New() *Logic { + return &Logic{} +} + +func init() { + service.SetHero(New()) +} + +// GetHeroByCode 根据 code 获取英雄信息 +func (l *Logic) GetHeroByCode(ctx context.Context, code string) (*entity.EpicHeroInfo, error) { + + // 2. 缓存未命中,查数据库 + var hero *entity.EpicHeroInfo + err := dao.EpicHeroInfo.Ctx(ctx). + Where(dao.EpicHeroInfo.Columns().HeroCode, code). + Scan(&hero) + if err != nil { + return nil, err + } + + return hero, nil +} + +// GetHeroList 查询所有英雄信息,并按创建时间倒序排列 +func (l *Logic) GetHeroList(ctx context.Context) ([]*v1.EpicHeroVO, error) { + redis := g.Redis() + cacheKey := "hero:list" + + // 1. 先查缓存 + value, err := redis.Get(ctx, cacheKey) + if err == nil && !value.IsEmpty() { + var voList []*v1.EpicHeroVO + if err := value.Scan(&voList); err == nil { + return voList, nil + } + } + + var ( + doList []*entity.EpicHeroInfo // 数据库原始结构 + voList []*v1.EpicHeroVO // 要返回的视图结构 + ) + + // 2. 缓存未命中,查数据库 + err = dao.EpicHeroInfo.Ctx(ctx). + OrderDesc(dao.EpicHeroInfo.Columns().CreateTime). // 按创建时间倒序 + Scan(&doList) + if err != nil { + return nil, err + } + + // 3. 手动映射 DO -> VO + for _, hero := range doList { + voList = append(voList, &v1.EpicHeroVO{ + Id: hero.Id, + HeroName: hero.HeroName, + HeroCode: hero.HeroCode, + Attribute: hero.Attribute, + HeadImgUrl: hero.HeadImgUrl, + HeroAttrLv60: hero.HeroAttrLv60, + NickName: hero.NickName, + Rarity: hero.Rarity, + Role: hero.Role, + Zodiac: hero.Zodiac, + Remark: hero.Remark, + }) + } + + return voList, nil +} + +func (l *Logic) GetHeroDetailByCode(ctx context.Context, code string) (*v1.HeroDetailVO, error) { + //TODO implement me + panic("implement me") +} + +// ClearHeroCache 清理英雄相关缓存 +func (l *Logic) ClearHeroCache(ctx context.Context, code string) error { + redis := g.Redis() + + // 清理单个英雄缓存 + if code != "" { + cacheKey := "hero:" + code + redis.Del(ctx, cacheKey) + } + + // 清理英雄列表缓存 + redis.Del(ctx, "hero:list") + + return nil +} diff --git a/internal/logic/logic.go b/internal/logic/logic.go new file mode 100644 index 0000000..59db98c --- /dev/null +++ b/internal/logic/logic.go @@ -0,0 +1,9 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package logic + +import ( + _ "epic/internal/logic/hero" +) diff --git a/internal/service/hero.go b/internal/service/hero.go new file mode 100644 index 0000000..3d498dc --- /dev/null +++ b/internal/service/hero.go @@ -0,0 +1,34 @@ +package service + +import ( + "context" + v1 "epic/api/hero/v1" + "epic/internal/model/entity" +) + +// HeroService 定义了英雄相关的业务接口 +type HeroService interface { + + // GetHeroByCode 根据 code 查询角色信息 + GetHeroByCode(ctx context.Context, code string) (*entity.EpicHeroInfo, error) + GetHeroList(ctx context.Context) ([]*v1.EpicHeroVO, error) + GetHeroDetailByCode(ctx context.Context, code string) (*v1.HeroDetailVO, error) + + // ClearHeroCache 清理英雄相关缓存 + ClearHeroCache(ctx context.Context, code string) error +} + +var heroService HeroService + +// Hero 返回 HeroService 的实例 +func Hero() HeroService { + if heroService == nil { + panic("implement not found for interface HeroService") + } + return heroService +} + +// SetHero 注册 HeroService 实现 +func SetHero(s HeroService) { + heroService = s +} diff --git a/main.go b/main.go index 430c529..b0611aa 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,9 @@ package main import ( + _ "epic/internal/logic" _ "epic/internal/packed" - + _ "github.com/gogf/gf/contrib/drivers/mysql/v2" "github.com/gogf/gf/v2/os/gctx" "epic/internal/cmd" diff --git a/manifest/config/config.yaml b/manifest/config/config.yaml new file mode 100644 index 0000000..75bb3be --- /dev/null +++ b/manifest/config/config.yaml @@ -0,0 +1,23 @@ +# https://goframe.org/docs/web/server-config-file-template +server: + address: ":8283" + openapiPath: "/api.json" + swaggerPath: "/swagger" + +# https://goframe.org/docs/core/glog-config +logger: + level: "all" + stdout: true + +# https://goframe.org/docs/core/gdb-config-file +database: + default: + link: "mysql:root:hu123456@tcp(193.112.151.199:3306)/wow" + debug: true + +# https://goframe.org/docs/core/gredis-config-file +redis: + default: + address: "193.112.151.199:6379" + db: 0 + pass: "hu123" \ No newline at end of file diff --git a/manifest/docker/Dockerfile b/manifest/docker/Dockerfile index d3abe8f..3913247 100644 --- a/manifest/docker/Dockerfile +++ b/manifest/docker/Dockerfile @@ -4,13 +4,12 @@ FROM loads/alpine:3.8 # INSTALLATION ############################################################################### -ENV WORKDIR /app -ADD resource $WORKDIR/ -ADD ./temp/linux_amd64/main $WORKDIR/main -RUN chmod +x $WORKDIR/main - -############################################################################### -# START -############################################################################### +ENV WORKDIR /app WORKDIR $WORKDIR -CMD ./main + +COPY main ./main +COPY config.yaml ./config.yaml + +RUN chmod +x ./main + +CMD ["./main"]