77 lines
2.2 KiB
Plaintext
77 lines
2.2 KiB
Plaintext
|
|
syntax = "v1"
|
||
|
|
|
||
|
|
type (
|
||
|
|
PersonaData {
|
||
|
|
ID string `json:"id"`
|
||
|
|
DisplayName string `json:"display_name,omitempty"`
|
||
|
|
Persona string `json:"persona,omitempty"`
|
||
|
|
Brief string `json:"brief,omitempty"`
|
||
|
|
ProductBrief string `json:"product_brief,omitempty"`
|
||
|
|
TargetAudience string `json:"target_audience,omitempty"`
|
||
|
|
Goals string `json:"goals,omitempty"`
|
||
|
|
StyleProfile string `json:"style_profile,omitempty"`
|
||
|
|
StyleBenchmark string `json:"style_benchmark,omitempty"`
|
||
|
|
CreateAt int64 `json:"create_at"`
|
||
|
|
UpdateAt int64 `json:"update_at"`
|
||
|
|
}
|
||
|
|
|
||
|
|
ListPersonasData {
|
||
|
|
List []PersonaData `json:"list"`
|
||
|
|
}
|
||
|
|
|
||
|
|
CreatePersonaReq {
|
||
|
|
DisplayName string `json:"display_name,optional"`
|
||
|
|
}
|
||
|
|
|
||
|
|
PersonaPath {
|
||
|
|
ID string `path:"id" validate:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
UpdatePersonaReq {
|
||
|
|
DisplayName *string `json:"display_name,optional"`
|
||
|
|
Persona *string `json:"persona,optional"`
|
||
|
|
Brief *string `json:"brief,optional"`
|
||
|
|
ProductBrief *string `json:"product_brief,optional"`
|
||
|
|
TargetAudience *string `json:"target_audience,optional"`
|
||
|
|
Goals *string `json:"goals,optional"`
|
||
|
|
StyleProfile *string `json:"style_profile,optional"`
|
||
|
|
StyleBenchmark *string `json:"style_benchmark,optional"`
|
||
|
|
}
|
||
|
|
|
||
|
|
StartPersonaStyleAnalysisReq {
|
||
|
|
BenchmarkUsername string `json:"benchmark_username" validate:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
StartPersonaStyleAnalysisData {
|
||
|
|
JobID string `json:"job_id"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
Message string `json:"message"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
@server(
|
||
|
|
group: persona
|
||
|
|
prefix: /api/v1/personas
|
||
|
|
middleware: AuthJWT
|
||
|
|
tags: "Persona"
|
||
|
|
summary: "Reusable persona profiles with 8D style strategy. Requires Bearer JWT."
|
||
|
|
)
|
||
|
|
service gateway {
|
||
|
|
@handler listPersonas
|
||
|
|
get / returns (ListPersonasData)
|
||
|
|
|
||
|
|
@handler createPersona
|
||
|
|
post / (CreatePersonaReq) returns (PersonaData)
|
||
|
|
|
||
|
|
@handler getPersona
|
||
|
|
get /:id (PersonaPath) returns (PersonaData)
|
||
|
|
|
||
|
|
@handler updatePersona
|
||
|
|
patch /:id (PersonaPath, UpdatePersonaReq) returns (PersonaData)
|
||
|
|
|
||
|
|
@handler deletePersona
|
||
|
|
delete /:id (PersonaPath)
|
||
|
|
|
||
|
|
@handler startPersonaStyleAnalysis
|
||
|
|
post /:id/style-analysis (PersonaPath, StartPersonaStyleAnalysisReq) returns (StartPersonaStyleAnalysisData)
|
||
|
|
}
|