Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Your Cashier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ahmad Abi Mulya
Your Cashier
Commits
69df54a4
Commit
69df54a4
authored
Sep 04, 2020
by
gandharyanto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix response push product
parent
c24f5ca6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
4 deletions
+117
-4
PushProductResponse.java
...m/example/yourcashiertest/models/PushProductResponse.java
+112
-0
ProductService.java
.../com/example/yourcashiertest/services/ProductService.java
+5
-4
No files found.
app/src/main/java/com/example/yourcashiertest/models/PushProductResponse.java
0 → 100644
View file @
69df54a4
package
com
.
example
.
yourcashiertest
.
models
;
import
com.google.gson.annotations.Expose
;
import
com.google.gson.annotations.SerializedName
;
public
class
PushProductResponse
{
@SerializedName
(
"status"
)
@Expose
private
Boolean
status
;
@SerializedName
(
"messages"
)
@Expose
private
String
messages
;
@SerializedName
(
"data"
)
@Expose
private
Data
data
;
public
Boolean
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Boolean
status
)
{
this
.
status
=
status
;
}
public
String
getMessages
()
{
return
messages
;
}
public
void
setMessages
(
String
messages
)
{
this
.
messages
=
messages
;
}
public
Data
getData
()
{
return
data
;
}
public
void
setData
(
Data
data
)
{
this
.
data
=
data
;
}
public
class
Data
{
@SerializedName
(
"name"
)
@Expose
private
String
name
;
@SerializedName
(
"price"
)
@Expose
private
Integer
price
;
@SerializedName
(
"description"
)
@Expose
private
String
description
;
@SerializedName
(
"category"
)
@Expose
private
String
category
;
@SerializedName
(
"stock"
)
@Expose
private
Integer
stock
;
@SerializedName
(
"images"
)
@Expose
private
String
images
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getPrice
()
{
return
price
;
}
public
void
setPrice
(
Integer
price
)
{
this
.
price
=
price
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
Integer
getStock
()
{
return
stock
;
}
public
void
setStock
(
Integer
stock
)
{
this
.
stock
=
stock
;
}
public
String
getImages
()
{
return
images
;
}
public
void
setImages
(
String
images
)
{
this
.
images
=
images
;
}
}
}
app/src/main/java/com/example/yourcashiertest/services/ProductService.java
View file @
69df54a4
package
com
.
example
.
yourcashiertest
.
services
;
package
com
.
example
.
yourcashiertest
.
services
;
import
com.example.yourcashiertest.models.PushProduct
;
import
com.example.yourcashiertest.models.PushProduct
;
import
com.example.yourcashiertest.models.PushProductResponse
;
import
com.example.yourcashiertest.models.ResponseLogin
;
import
com.example.yourcashiertest.models.ResponseLogin
;
import
com.example.yourcashiertest.models.ResponseUser
;
import
com.example.yourcashiertest.models.ResponseUser
;
import
com.example.yourcashiertest.models.User
;
import
com.example.yourcashiertest.models.User
;
...
@@ -14,14 +15,14 @@ import retrofit2.http.PUT;
...
@@ -14,14 +15,14 @@ import retrofit2.http.PUT;
public
interface
ProductService
{
public
interface
ProductService
{
@GET
(
"v1/
customer
"
)
@GET
(
"v1/
product
"
)
Call
<
ResponseUser
>
getProduct
();
Call
<
String
>
getProduct
();
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
"v1/product"
)
@POST
(
"v1/product"
)
Call
<
User
>
createProduct
(
@Body
PushProduct
pushProduct
);
Call
<
PushProductResponse
>
createProduct
(
@Body
PushProduct
pushProduct
);
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@PUT
(
"v1/product/{id}"
)
@PUT
(
"v1/product/{id}"
)
Call
<
ResponseLogin
>
updateProduct
(
@Body
PushProduct
pushProduct
);
Call
<
PushProductResponse
>
updateProduct
(
@Body
PushProduct
pushProduct
);
}
}
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