This commit is contained in:
david 2024-02-27 22:32:45 +08:00
parent 1bd68b7efd
commit b8f8a7bfda
5 changed files with 78 additions and 20 deletions

View File

@ -1,7 +1,10 @@
import request from "../../request"; import request from "../../request";
import { AxiosPromise } from "axios"; import { AxiosPromise } from "axios";
import { ByPosRequest,ByPosReply } from "./types"; import { ByPosRequest,ByPosReply } from "./types";
// 通过广告位获取广告信息 // 通过广告位获取广告信息
export function ByPos(data: ByPosRequest): AxiosPromise<ByPosReply> { export function ByPos(data: ByPosRequest): AxiosPromise<ByPosReply> {
return request({ return request({

View File

@ -1,16 +1,20 @@
export interface ByPosRequest { export interface ByPosRequest {
key?: string; // ping码 key?: string;
} }
export interface ByPosReply { export interface ByPosReply {
data?: AdsItem[];// 状态码 data?: AdsItem[];
} }
export interface AdsItem { export interface AdsItem {
id?: number; id?: number;
title?: string; // 广告名称 title?: string; // 广告名称
content?: string; // 广告内容 content?: string; // 广告内容
number?: number;//广告类型 1.文本 2.图片 3.视频 type?: number; // 广告类型 1.文本 2.图片 3.视频
toUrl?: string; toUrl?: string;
created?: string; created?: string;
} }

View File

@ -1,7 +1,11 @@
import request from "../../request"; import request from "../../request";
import { AxiosPromise } from "axios"; import { AxiosPromise } from "axios";
import { Crc,StatusReply } from "./types"; import { Crc,StatusReply,CheckForUpdatesRequest,CheckForUpdatesReply } from "./types";
// HELLO
export function Hello(data: Crc): AxiosPromise<StatusReply> { export function Hello(data: Crc): AxiosPromise<StatusReply> {
return request({ return request({
url: "/initialize.Check.Hello", url: "/initialize.Check.Hello",
@ -9,3 +13,13 @@ export function Hello(data: Crc): AxiosPromise<StatusReply> {
data: data, data: data,
}); });
} }
// 检查更新
export function Updates(data: CheckForUpdatesRequest): AxiosPromise<CheckForUpdatesReply> {
return request({
url: "/initialize.Check.Updates",
method: "post",
data: data,
});
}

View File

@ -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<ConfigureReply> {
return request({
url: "/initialize.Data.Configure",
method: "post",
data: data,
});
}
// 系统区域数据
export function Areas(data: Empty): AxiosPromise<AreasReply> {
return request({
url: "/initialize.Data.Areas",
method: "post",
data: data,
});
}
// 系统标签数据
export function Tags(data: Empty): AxiosPromise<TagsReply> {
return request({
url: "/initialize.Data.Tags",
method: "post",
data: data,
});
}

View File

@ -23,7 +23,9 @@ func main() {
srvPaths := getSubDirs(protoPath) srvPaths := getSubDirs(protoPath)
fmt.Println("Root:", protoPath, srvPaths, "JS Out:", jsPath) 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 { if len(descs[0].GetServices()) > 0 {
for _, srvItem := range descs[0].GetServices() { 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())
} }
} }