equipment
CI / changes (push) Successful in 37s
CI / ad (push) Successful in 12s
CI / admin (push) Successful in 10s
CI / bff (push) Successful in 10s
CI / chore (push) Successful in 10s
CI / equipment (push) Successful in 3m10s
CI / express (push) Successful in 10s
CI / product (push) Successful in 10s
CI / sale (push) Successful in 10s
CI / task (push) Successful in 10s
CI / user (push) Successful in 11s
CI / wecom (push) Successful in 10s
CI / changes (push) Successful in 37s
CI / ad (push) Successful in 12s
CI / admin (push) Successful in 10s
CI / bff (push) Successful in 10s
CI / chore (push) Successful in 10s
CI / equipment (push) Successful in 3m10s
CI / express (push) Successful in 10s
CI / product (push) Successful in 10s
CI / sale (push) Successful in 10s
CI / task (push) Successful in 10s
CI / user (push) Successful in 11s
CI / wecom (push) Successful in 10s
This commit is contained in:
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- name: Detect changes
|
- name: Detect changes
|
||||||
id: filter
|
id: filter
|
||||||
run: |
|
run: |
|
||||||
SERVICES="bff product admin user ad chore express sale wecom task"
|
SERVICES="bff product admin user ad chore express sale wecom task equipment"
|
||||||
|
|
||||||
pattern_for() {
|
pattern_for() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -91,6 +91,7 @@ jobs:
|
|||||||
- sale
|
- sale
|
||||||
- wecom
|
- wecom
|
||||||
- task
|
- task
|
||||||
|
- equipment
|
||||||
env:
|
env:
|
||||||
BUILD_LIST: ${{ needs.changes.outputs.build_list }}
|
BUILD_LIST: ${{ needs.changes.outputs.build_list }}
|
||||||
NAME: lone/${{ matrix.name }}
|
NAME: lone/${{ matrix.name }}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
FROM golang:1.26.5-alpine AS builder
|
FROM golang:1.26.5-alpine AS builder
|
||||||
|
|
||||||
|
ARG SERVICE_NAME=equipment
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
ENV GOPROXY=https://goproxy.cn,direct \
|
ENV GOPROXY=https://goproxy.cn,direct \
|
||||||
@@ -14,9 +16,9 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
|||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
COPY rpc/ ./rpc
|
COPY rpc/ ./rpc
|
||||||
COPY services/equipment/ ./services/equipment/
|
COPY services/${SERVICE_NAME}/ ./services/${SERVICE_NAME}/
|
||||||
|
|
||||||
WORKDIR /src/services/equipment
|
WORKDIR /src/services/${SERVICE_NAME}
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||||
--mount=type=cache,target=/root/.cache/go-build \
|
--mount=type=cache,target=/root/.cache/go-build \
|
||||||
@@ -24,6 +26,8 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
|||||||
|
|
||||||
FROM alpine:3.22
|
FROM alpine:3.22
|
||||||
|
|
||||||
|
ARG SERVICE_NAME=equipment
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
@@ -34,4 +38,4 @@ RUN apk add --no-cache tzdata \
|
|||||||
|
|
||||||
COPY --from=builder /out/main .
|
COPY --from=builder /out/main .
|
||||||
|
|
||||||
CMD ["./main", "-f", "etc/equipment.yaml"]
|
CMD ["./main", "-f", "etc/${SERVICE_NAME}.yaml"]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"lone-services/pkg/utils"
|
"lone-services/pkg/utils"
|
||||||
"lone-services/services/equipment/internal/dao"
|
"lone-services/services/equipment/internal/dao"
|
||||||
"lone-services/services/equipment/internal/model"
|
"lone-services/services/equipment/internal/model"
|
||||||
"lone-services/services/task/validator"
|
"lone-services/services/equipment/validator"
|
||||||
|
|
||||||
"lone-services/rpc/equipment/pb"
|
"lone-services/rpc/equipment/pb"
|
||||||
"lone-services/services/equipment/internal/svc"
|
"lone-services/services/equipment/internal/svc"
|
||||||
@@ -29,7 +29,7 @@ func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *CreateLogic) Create(in *equipment.CreateRequest) (*equipment.Response, error) {
|
func (l *CreateLogic) Create(in *equipment.CreateRequest) (*equipment.Response, error) {
|
||||||
var v validator.TaskCreateValidator
|
var v validator.VersionCreateValidator
|
||||||
if fail := l.checkParams(in, &v); fail != nil {
|
if fail := l.checkParams(in, &v); fail != nil {
|
||||||
return fail, nil
|
return fail, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"lone-services/pkg/utils"
|
"lone-services/pkg/utils"
|
||||||
"lone-services/services/equipment/internal/dao"
|
"lone-services/services/equipment/internal/dao"
|
||||||
"lone-services/services/equipment/internal/model"
|
"lone-services/services/equipment/internal/model"
|
||||||
"lone-services/services/task/validator"
|
"lone-services/services/equipment/validator"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"lone-services/rpc/equipment/pb"
|
"lone-services/rpc/equipment/pb"
|
||||||
@@ -31,7 +31,7 @@ func NewEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EditLogic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *EditLogic) Edit(in *equipment.EditRequest) (*equipment.Response, error) {
|
func (l *EditLogic) Edit(in *equipment.EditRequest) (*equipment.Response, error) {
|
||||||
var v validator.TaskEditValidator
|
var v validator.VersionEditValidator
|
||||||
if fail := l.checkParams(in, &v); fail != nil {
|
if fail := l.checkParams(in, &v); fail != nil {
|
||||||
return fail, nil
|
return fail, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type VersionCreateValidator struct {
|
|||||||
Version string `form:"version" json:"version" validate:"required"`
|
Version string `form:"version" json:"version" validate:"required"`
|
||||||
FirmwareSrc string `form:"firmware_src" json:"firmware_src" validate:"required"`
|
FirmwareSrc string `form:"firmware_src" json:"firmware_src" validate:"required"`
|
||||||
Describe string `form:"describe" json:"describe" validate:"required"`
|
Describe string `form:"describe" json:"describe" validate:"required"`
|
||||||
Type uint8 `form:"type" json:"type" validate:"required"`
|
Type int32 `form:"type" json:"type" validate:"required"`
|
||||||
SoftSrc string `form:"soft_src" json:"soft_src"`
|
SoftSrc string `form:"soft_src" json:"soft_src"`
|
||||||
AddSrc string `form:"add_src" json:"add_src"`
|
AddSrc string `form:"add_src" json:"add_src"`
|
||||||
SoftConfig string `form:"soft_config" json:"soft_config"`
|
SoftConfig string `form:"soft_config" json:"soft_config"`
|
||||||
@@ -24,12 +24,12 @@ func (p VersionCreateValidator) GetMessage() validate.ValidatorMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type VersionEditValidator struct {
|
type VersionEditValidator struct {
|
||||||
Id int `form:"id" json:"id" validate:"required"`
|
Id int64 `form:"id" json:"id" validate:"required"`
|
||||||
HardwareVersion string `form:"hardware_version" json:"hardware_version" validate:"required"`
|
HardwareVersion string `form:"hardware_version" json:"hardware_version" validate:"required"`
|
||||||
Version string `form:"version" json:"version" validate:"required"`
|
Version string `form:"version" json:"version" validate:"required"`
|
||||||
FirmwareSrc string `form:"firmware_src" json:"firmware_src" validate:"required"`
|
FirmwareSrc string `form:"firmware_src" json:"firmware_src" validate:"required"`
|
||||||
Describe string `form:"describe" json:"describe" validate:"required"`
|
Describe string `form:"describe" json:"describe" validate:"required"`
|
||||||
Type uint8 `form:"type" json:"type" validate:"required"`
|
Type int32 `form:"type" json:"type" validate:"required"`
|
||||||
SoftSrc string `form:"soft_src" json:"soft_src"`
|
SoftSrc string `form:"soft_src" json:"soft_src"`
|
||||||
AddSrc string `form:"add_src" json:"add_src"`
|
AddSrc string `form:"add_src" json:"add_src"`
|
||||||
SoftConfig string `form:"soft_config" json:"soft_config"`
|
SoftConfig string `form:"soft_config" json:"soft_config"`
|
||||||
|
|||||||
Reference in New Issue
Block a user