From b8f8a7bfda1c4614ce9fed19b7e4f05614c78f1c Mon Sep 17 00:00:00 2001 From: david Date: Tue, 27 Feb 2024 22:32:45 +0800 Subject: [PATCH] dev --- axios/service/ads/Fetch.ts | 17 ++++++++------- axios/service/ads/types.ts | 20 +++++++++++------- axios/service/initialize/check.ts | 20 +++++++++++++++--- axios/service/initialize/data.ts | 35 +++++++++++++++++++++++++++++++ cli/main.go | 6 ++++-- 5 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 axios/service/initialize/data.ts diff --git a/axios/service/ads/Fetch.ts b/axios/service/ads/Fetch.ts index 44e67ba..53e8552 100644 --- a/axios/service/ads/Fetch.ts +++ b/axios/service/ads/Fetch.ts @@ -1,12 +1,15 @@ + import request from "../../request"; import { AxiosPromise } from "axios"; import { ByPosRequest,ByPosReply } from "./types"; -// 通过广告位获取广告信息 + + + // 通过广告位获取广告信息 export function ByPos(data: ByPosRequest): AxiosPromise { - return request({ - url: "/ads.Fetch.ByPos", - method: "post", - data: data, - }); -} \ No newline at end of file + return request({ + url: "/ads.Fetch.ByPos", + method: "post", + data: data, +}); +} diff --git a/axios/service/ads/types.ts b/axios/service/ads/types.ts index 31b78cf..9a1faa0 100644 --- a/axios/service/ads/types.ts +++ b/axios/service/ads/types.ts @@ -1,16 +1,20 @@ + + export interface ByPosRequest { - key?: string; // ping码 + key?: string; } + export interface ByPosReply { - data?: AdsItem[];// 状态码 + data?: AdsItem[]; } + export interface AdsItem { - id?: number; - title?: string;//广告名称 - content?: string;//广告内容 - number?: number;//广告类型 1.文本 2.图片 3.视频 - toUrl?: string; - created?: string; + id?: number; + title?: string; // 广告名称 + content?: string; // 广告内容 + type?: number; // 广告类型 1.文本 2.图片 3.视频 + toUrl?: string; + created?: string; } \ No newline at end of file diff --git a/axios/service/initialize/check.ts b/axios/service/initialize/check.ts index af4b510..acbfc14 100644 --- a/axios/service/initialize/check.ts +++ b/axios/service/initialize/check.ts @@ -1,11 +1,25 @@ + import request from "../../request"; import { AxiosPromise } from "axios"; -import { Crc,StatusReply } from "./types"; +import { Crc,StatusReply,CheckForUpdatesRequest,CheckForUpdatesReply } from "./types"; + + + // HELLO export function Hello(data: Crc): AxiosPromise { return request({ url: "/initialize.Check.Hello", method: "post", data: data, - }); -} \ No newline at end of file +}); +} + + + // 检查更新 +export function Updates(data: CheckForUpdatesRequest): AxiosPromise { + return request({ + url: "/initialize.Check.Updates", + method: "post", + data: data, +}); +} diff --git a/axios/service/initialize/data.ts b/axios/service/initialize/data.ts new file mode 100644 index 0000000..9d64819 --- /dev/null +++ b/axios/service/initialize/data.ts @@ -0,0 +1,35 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { ConfigureRequest,ConfigureReply,Empty,AreasReply,TagsReply } from "./types"; + + + + // 获取应用的相关配置信息 +export function Configure(data: ConfigureRequest): AxiosPromise { + return request({ + url: "/initialize.Data.Configure", + method: "post", + data: data, +}); +} + + + // 系统区域数据 +export function Areas(data: Empty): AxiosPromise { + return request({ + url: "/initialize.Data.Areas", + method: "post", + data: data, +}); +} + + + // 系统标签数据 +export function Tags(data: Empty): AxiosPromise { + return request({ + url: "/initialize.Data.Tags", + method: "post", + data: data, +}); +} diff --git a/cli/main.go b/cli/main.go index 26d520f..cc45e4b 100644 --- a/cli/main.go +++ b/cli/main.go @@ -23,7 +23,9 @@ func main() { srvPaths := getSubDirs(protoPath) fmt.Println("Root:", protoPath, srvPaths, "JS Out:", jsPath) - parseProtos(protoPath, srvPaths[1]) + for _, v := range srvPaths { + parseProtos(protoPath, v) + } } @@ -68,7 +70,7 @@ func parseProtos(root, dir string) { if len(descs[0].GetServices()) > 0 { for _, srvItem := range descs[0].GetServices() { - writeSrvs(dir, tsPath, srvItem.GetName(), *srvItem.GetSourceInfo().TrailingComments, srvItem.GetMethods()) + writeSrvs(dir, tsPath, srvItem.GetName(), srvItem.GetSourceInfo().GetLeadingComments(), srvItem.GetMethods()) } }