Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat-publish-service' into feat-…
Browse files Browse the repository at this point in the history
…feed-service

# Conflicts:
#	constant/biz/response.go
  • Loading branch information
shaokeyibb committed Feb 10, 2023
2 parents 5f35ade + cb4b704 commit 950c5bc
Show file tree
Hide file tree
Showing 15 changed files with 202 additions and 486 deletions.
10 changes: 10 additions & 0 deletions constant/biz/publish.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package biz

const (
InvalidContentType = 400001
Unable2GenerateUUID = 500001
Unable2CreateThumbnail = 500002
Unable2UploadVideo = 500003
Unable2UploadCover = 500004
Unable2CreateDBEntry = 500005
)
5 changes: 2 additions & 3 deletions constant/biz/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const (
var (
OkStatusMsg = "OK"

BadRequestStatusMsg = "Unable to finish request, please check your parameters. If you think this is a bug, please contact us."

InternalErrorMsg = "Internal error occurred, please contact us."
BadRequestStatusMsg = "Unable to finish request, please check your parameters. If you think this is a bug, please contact us."
InternalServerErrorStatusMsg = "The server had an error while processing your request. Sorry about that!"
)
2 changes: 1 addition & 1 deletion constant/config/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const WebServiceAddr = ":40126"
const AuthServiceName = "toktik-auth-api"
const AuthServiceAddr = ":40127"

const PublishServiceName = "toktik-publish"
const PublishServiceName = "toktik-publish-api"
const PublishServiceAddr = ":40128"

const FeedServiceName = "toktik-feed-api"
Expand Down
10 changes: 5 additions & 5 deletions idl/publish.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package douyin.publish;
option go_package = "douyin/publish";

message CreateVideoRequest {
uint32 userId = 1;
bytes data = 2;
string title = 3;
uint32 userId = 1 [json_name = "user_id"]; // 用户id
bytes data = 2; // 视频数据
string title = 3; // 视频标题
}

message CreateVideoResponse {
uint32 status_code = 1; // 状态码,0-成功,其他值-失败
string status_msg = 2; // 返回状态描述
uint32 status_code = 1 [json_name = "status_code"]; // 状态码,0-成功,其他值-失败
string status_msg = 2 [json_name = "status_msg"]; // 返回状态描述
}

service PublishService {
Expand Down
48 changes: 48 additions & 0 deletions manifests-dev/deployment-toktik-http-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
sidecar.jaegertracing.io/inject: 'true'
labels:
app: toktik-http-api
name: toktik-http-api
namespace: toktik-service-bundle
spec:
selector:
matchLabels:
name: toktik-http-api
template:
metadata:
labels:
app: toktik-http-api
branch: dev
version: ${BUILD_NUMBER}-${CI_COMMIT_ID}
name: toktik-http-api
dream-app: toktik-http-api
dream-unit: toktik-http-api
spec:
imagePullSecrets:
- name: regcred
containers:
- image: ${IMAGE}
imagePullPolicy: IfNotPresent
name: toktik-http-api
command:
- bin/web
envFrom:
- configMapRef:
name: env-config
- configMapRef:
name: config
ports:
- name: http-40126
containerPort: 40126
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 8Mi
terminationGracePeriodSeconds: 30
50 changes: 50 additions & 0 deletions manifests-dev/deployment-toktik-publish-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
sidecar.jaegertracing.io/inject: 'true'
labels:
app: toktik-publish-api
name: toktik-publish-api
namespace: toktik-service-bundle
spec:
selector:
matchLabels:
name: toktik-publish-api
template:
metadata:
labels:
app: toktik-publish-api
branch: dev
version: ${BUILD_NUMBER}-${CI_COMMIT_ID}
name: toktik-publish-api
dream-app: toktik-publish-api
dream-unit: toktik-publish-api
spec:
imagePullSecrets:
- name: regcred
containers:
- image: ${IMAGE}
imagePullPolicy: IfNotPresent
name: toktik-publish-api
command:
- /bin/bash
args:
- bootstrap-publish.sh
envFrom:
- configMapRef:
name: env-config
- configMapRef:
name: config
ports:
- name: grpc-40128
containerPort: 40128
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 8Mi
terminationGracePeriodSeconds: 30
17 changes: 17 additions & 0 deletions manifests-dev/service-toktik-http-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: toktik-http-api
name: toktik-http-api
namespace: toktik-service-bundle
spec:
ports:
- name: http
port: 40126
protocol: TCP
targetPort: 40126
selector:
name: toktik-http-api
branch: dev
type: ClusterIP
17 changes: 17 additions & 0 deletions manifests-dev/service-toktik-publish-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: toktik-publish-api
name: toktik-publish-api
namespace: toktik-service-bundle
spec:
ports:
- name: grpc
port: 40128
protocol: TCP
targetPort: 40128
selector:
name: toktik-publish-api
branch: dev
type: ClusterIP
8 changes: 0 additions & 8 deletions repo/gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 950c5bc

Please sign in to comment.