feat: api can modify token's used and remains

- Updated base image in Dockerfile from `node:16` to `node:18`
- Added `tokenPatch` struct to handle updates to the `Token` model
- Updated `UpdateToken` function to use `tokenPatch` struct for binding JSON
- Improved error handling and validation for token updates
- Refined checks for token status, expiration, and quota
- Enhanced error handling and response for token updates
- Updated JSON response to include `data` field
This commit is contained in:
Laisky.Cai
2023-09-29 12:46:26 +00:00
parent f9b748c2ca
commit bc8ceca742
2 changed files with 67 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
FROM node:16 as builder
FROM node:18 as builder
WORKDIR /build
COPY web/package.json .
@@ -7,7 +7,7 @@ COPY ./web .
COPY ./VERSION .
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
FROM golang AS builder2
FROM golang:1.21.1 AS builder2
ENV GO111MODULE=on \
CGO_ENABLED=1 \