-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add product role and use bing search
- Loading branch information
1 parent
6fc04d6
commit 99c9084
Showing
23 changed files
with
679 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/top/rslly/iot/dao/ProductRoleRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright © 2023-2030 The ruanrongman Authors | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package top.rslly.iot.dao; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import top.rslly.iot.models.ProductRoleEntity; | ||
|
||
import java.util.List; | ||
|
||
public interface ProductRoleRepository extends JpaRepository<ProductRoleEntity, Integer> { | ||
List<ProductRoleEntity> findAllById(int id); | ||
|
||
List<ProductRoleEntity> findAllByProductId(int productId); | ||
|
||
@Transactional | ||
List<ProductRoleEntity> deleteById(int id); | ||
} |
126 changes: 126 additions & 0 deletions
126
src/main/java/top/rslly/iot/models/ProductRoleEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/** | ||
* Copyright © 2023-2030 The ruanrongman Authors | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package top.rslly.iot.models; | ||
|
||
import javax.persistence.*; | ||
import java.util.Objects; | ||
|
||
@Entity | ||
@Table(name = "product_role", schema = "cwliot1.8", catalog = "") | ||
public class ProductRoleEntity { | ||
|
||
private int id; | ||
private int productId; | ||
private String assistantName; | ||
private String userName; | ||
private String role; | ||
private String roleIntroduction; | ||
private String voice; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
@Basic | ||
@Column(name = "product_id") | ||
public int getProductId() { | ||
return productId; | ||
} | ||
|
||
public void setProductId(int productId) { | ||
this.productId = productId; | ||
} | ||
|
||
@Basic | ||
@Column(name = "assistant_name") | ||
public String getAssistantName() { | ||
return assistantName; | ||
} | ||
|
||
public void setAssistantName(String assistantName) { | ||
this.assistantName = assistantName; | ||
} | ||
|
||
@Basic | ||
@Column(name = "user_name") | ||
public String getUserName() { | ||
return userName; | ||
} | ||
|
||
public void setUserName(String userName) { | ||
this.userName = userName; | ||
} | ||
|
||
@Basic | ||
@Column(name = "role") | ||
public String getRole() { | ||
return role; | ||
} | ||
|
||
public void setRole(String role) { | ||
this.role = role; | ||
} | ||
|
||
@Basic | ||
@Column(name = "role_introduction") | ||
public String getRoleIntroduction() { | ||
return roleIntroduction; | ||
} | ||
|
||
public void setRoleIntroduction(String roleIntroduction) { | ||
this.roleIntroduction = roleIntroduction; | ||
} | ||
|
||
@Basic | ||
@Column(name = "voice") | ||
public String getVoice() { | ||
return voice; | ||
} | ||
|
||
public void setVoice(String voice) { | ||
this.voice = voice; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
ProductRoleEntity that = (ProductRoleEntity) o; | ||
return id == that.id && productId == that.productId | ||
&& Objects.equals(assistantName, that.assistantName) | ||
&& Objects.equals(userName, that.userName) && Objects.equals(role, that.role) | ||
&& Objects.equals(roleIntroduction, that.roleIntroduction) | ||
&& Objects.equals(voice, that.voice); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, productId, assistantName, userName, role, roleIntroduction, voice); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/top/rslly/iot/param/request/ProductRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright © 2023-2030 The ruanrongman Authors | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package top.rslly.iot.param.request; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class ProductRole { | ||
private int productId; | ||
private String assistantName; | ||
private String userName; | ||
private String role; | ||
private String roleIntroduction; | ||
private String voice; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/top/rslly/iot/services/ProductRoleService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright © 2023-2030 The ruanrongman Authors | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package top.rslly.iot.services; | ||
|
||
import top.rslly.iot.models.ProductRoleEntity; | ||
import top.rslly.iot.param.request.ProductRole; | ||
import top.rslly.iot.utility.result.JsonResult; | ||
|
||
import java.util.List; | ||
|
||
public interface ProductRoleService { | ||
|
||
List<ProductRoleEntity> findAllById(int id); | ||
|
||
List<ProductRoleEntity> findAllByProductId(int productId); | ||
|
||
JsonResult<?> getProductRole(String token); | ||
|
||
JsonResult<?> postProductRole(ProductRole productRole); | ||
|
||
JsonResult<?> putProductRole(ProductRole productRole); | ||
|
||
JsonResult<?> deleteProductRole(int id); | ||
} |
Oops, something went wrong.