Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4906cecd
authored
Mar 30, 2023
by
Siyu Kong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增商品属性api
parent
d6f2eafb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
0 deletions
+103
-0
src/api/mall/product/property.ts
+103
-0
No files found.
src/api/mall/product/property.ts
0 → 100644
View file @
4906cecd
import
request
from
'@/config/axios'
/**
* 商品属性
*/
export
interface
PropertyVO
{
id
?:
number
/** 名称 */
name
:
string
/** 备注 */
remark
?:
string
}
/**
* 属性值
*/
export
interface
PropertyValueVO
{
id
?:
number
/** 属性项的编号 */
propertyId
?:
number
/** 名称 */
name
:
string
/** 备注 */
remark
?:
string
}
/**
* 商品属性值的明细
*/
export
interface
PropertyValueDetailVO
{
/** 属性项的编号 */
propertyId
:
number
// 属性的编号
/** 属性的名称 */
propertyName
:
string
/** 属性值的编号 */
valueId
:
number
/** 属性值的名称 */
valueName
:
string
}
// ------------------------ 属性项 -------------------
// 创建属性项
export
const
createProperty
=
(
data
:
PropertyVO
)
=>
{
return
request
.
post
({
url
:
'/product/property/create'
,
data
})
}
// 更新属性项
export
const
updateProperty
=
(
data
:
PropertyVO
)
=>
{
return
request
.
put
({
url
:
'/product/property/update'
,
data
})
}
// 删除属性项
export
const
deleteProperty
=
(
id
:
number
)
=>
{
return
request
.
delete
({
url
:
`/product/property/delete?id=
${
id
}
`
})
}
// 获得属性项
export
const
getProperty
=
(
id
:
number
):
Promise
<
PropertyVO
>
=>
{
return
request
.
get
({
url
:
`/product/property/get?id=
${
id
}
`
})
}
// 获得属性项分页
export
const
getPropertyPage
=
(
params
:
PageParam
&
any
)
=>
{
return
request
.
get
({
url
:
'/product/property/page'
,
params
})
}
// 获得属性项列表
export
const
getPropertyList
=
(
params
:
any
)
=>
{
return
request
.
get
({
url
:
'/product/property/list'
,
params
})
}
// 获得属性项列表
export
const
getPropertyListAndValue
=
(
params
:
any
)
=>
{
return
request
.
get
({
url
:
'/product/property/get-value-list'
,
params
})
}
// ------------------------ 属性值 -------------------
// 获得属性值分页
export
const
getPropertyValuePage
=
(
params
:
PageParam
&
any
)
=>
{
return
request
.
get
({
url
:
'/product/property/value/page'
,
params
})
}
// 获得属性值
export
const
getPropertyValue
=
(
id
:
number
):
Promise
<
PropertyValueVO
>
=>
{
return
request
.
get
({
url
:
`/product/property/value/get?id=
${
id
}
`
})
}
// 创建属性值
export
const
createPropertyValue
=
(
data
:
PropertyValueVO
)
=>
{
return
request
.
post
({
url
:
'/product/property/value/create'
,
data
})
}
// 更新属性值
export
const
updatePropertyValue
=
(
data
:
PropertyValueVO
)
=>
{
return
request
.
put
({
url
:
'/product/property/value/update'
,
data
})
}
// 删除属性值
export
const
deletePropertyValue
=
(
id
:
number
)
=>
{
return
request
.
delete
({
url
:
`/product/property/value/delete?id=
${
id
}
`
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment